moz-radio has visible focus after clicking it
Categories
(Toolkit :: UI Widgets, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox137 | --- | fixed |
People
(Reporter: mstriemer, Assigned: tgiles)
References
Details
(Whiteboard: [recomp] [lang=js])
Attachments
(1 external file, 1 obsolete file)
In MozRadio's handleClick() method it focuses the input, which doesn't seem correct. This causes it to show a focus ring when it is clicked, which is undesirable
I believe this was added so that when using the arrow keys we can call radio.click() and it will select the radio and focus it. When we stop focusing the radio on click then that code will likely need to explicitly move the focus to the newly selected radio in MozRadioGroup navigate()
Updated•2 years ago
|
May I give this one a shot? I'm a new contributor but I think I understand this request's objective enough to be able to give it a try.
Just to confirm my understanding: In other words, it seems like the end-result of clicking a new radio with this current functionality is what is intended. But the current functionality should not be focusing the newly selected radio in handleClick(), but rather focusing it in navigate()?
Updated•2 years ago
|
| Reporter | ||
Comment 2•2 years ago
|
||
Thanks for the interest Spencer! Unfortunately we had this one in the onboarding plan for Mark so he's started looking into it, turns out it might be bigger than anticipated.
If you're looking for good bugs to work on here are a few that look actionable in the UI Widgets component: bug 1928413, bug 1917910, bug 1868950 and bug 1852625
If there's a particular area you'd be interested in contributing to then feel free to reach out on Matrix as well and we can try to find something for you! https://matrix.to/#/#reusable-components:mozilla.org
Updated•1 year ago
|
Comment 3•1 year ago
|
||
This should be better than the current thing, I think.
On macOS, accessibility.mouse_focuses_formcontrol is true only on
content docs.
In content docs, clicking the <label> focuses the <input> (so the
explicit .focus() call is not needed).
In chrome docs on macOS, we don't have any previous focus to crib from,
but still we should probably not show a focus ring if we're handling a
mouse event on the stack.
Updated•1 year ago
|
Updated•1 year ago
|
Comment 4•1 year ago
|
||
I think it's probably better to fix this on the front-end for now, given the results in https://treeherder.mozilla.org/jobs?repo=try&revision=7b02a2c882f14f138360747fa4ac2afd59b49ba5&selectedTaskRun=K8q1yYL4Q8qB3wZtrrrQIA.0
Updated•1 year ago
|
| Reporter | ||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 5•1 year ago
|
||
Due to how macOS handles focus for radio buttons in native dialogs,
we needed to change how moz-radio behaves in the chrome UI. In macOS,
clicking a radio button in a native dialog does not activate a focus
ring nor does the click move the focus to that radio button. These
changes allow the moz-radio element to be clicked in the chrome UI
without moving focus.
Due to the requested behavior, we needed to change how moz-radio-group
handled keyboard navigation and how moz-radio handled click events.
Now moz-radio-group behaves as the source of truth for the state of
its child moz-radio elements. This involves calling the relevant
focus() method on the appropriate moz-radio element as well as
emitting 'input' and 'change' events on keyboard navigation between
radio buttons.
Since this change specifically changes the macOS behavior, the relevant
tests needed to have specific cases for macOS. This mainly involves
calling mozRadio.focus() if the test_moz_radio_group.html test
clicks a moz-radio element.
Additionally, due to the moz-radio element no longer handling the 'click'
event by clicking its inner HTML input element, the events we verify
in our test had to be updated.
Updated•1 year ago
|
Comment 7•1 year ago
|
||
| bugherder | ||
Description
•