moz-input-{text,search} value attribute is a bit footgunny.
Categories
(Toolkit :: UI Widgets, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox144 | --- | fixed |
People
(Reporter: emilio, Assigned: mlucks, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [recomp] [lang=js])
Attachments
(1 file)
MozInputText and subclasses use a public value member to track the current input value:
Instead of forwarding to the real input. That causes code like input.value = "foo" from an external consumer to not behave as expected. It changes the internal state of MozInputText, but it doesn't get reflected in the <input> element.
Comment 1•4 months ago
|
||
The issue is caused by not using .value here: https://searchfox.org/mozilla-central/rev/b3386c22cefca2225cf190522b1862c12765d1ba/toolkit/content/widgets/moz-input-text/moz-input-text.mjs#54
Could be prevented in the future by using: https://github.com/43081j/eslint-plugin-lit/blob/master/docs/rules/no-value-attribute.md
:hjones, here's that needinfo you requested for creating a bug for the eslint no value attribute rule.
Comment 2•4 months ago
|
||
To help Mozilla out with this bug, here's the steps:
- Comment here on the bug that you want to volunteer to help.
This will tell others that you're working on the next steps. - Download and build the Firefox source code
- If you have any problems, please ask on Element/Matrix in the
#introductionchannel. They're there to help you get started.
- If you have any problems, please ask on Element/Matrix in the
- Start working on this bug. You will need to update line 56 in moz-input-text.mjs so that it reads
.valueinstead ofvalue.- If you have any problems with this bug, please comment on this bug and set the needinfo flag for me by using the "Request information from" checkbox and setting the dropdown select to "mentor". Also, you can find me and my teammates on the
#reusable-componentschannel on Element/Matrix most hours of most days.
- If you have any problems with this bug, please comment on this bug and set the needinfo flag for me by using the "Request information from" checkbox and setting the dropdown select to "mentor". Also, you can find me and my teammates on the
- Build your change with
./mach buildand test your change with./mach test toolkit/content/tests/widgets/ --headless. Also check your changes for adherence to our style guidelines by using./mach lint. - Submit the patch (including an automated test, if applicable) for review. Mark me as a reviewer so I'll get an email to come look at your code.
- How to Submit a Patch
- This is when the bug will be assigned to you.
- After a series of reviews and changes to your patch, I'll push it to autoland.
- If there are changes requested, please read the "To update a submitted patch" section to ensure you don't accidentally create a duplicate revision!
- Your code will soon be shipping to Firefox users worldwide!
- ...now you get to think about what kind of bug you'd like to work on next.
Let me know what you're interested in and I can help you find your next contribution.
Updated•4 months ago
|
Updated•4 months ago
|
Comment 5•4 months ago
|
||
| bugherder | ||
Updated•3 months ago
|
Description
•