Closed
Bug 127118
Opened 24 years ago
Closed 21 years ago
Pressing access key for radio button doesn't focus radio group or show focus on radio button
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P1)
Tracking
()
RESOLVED
FIXED
People
(Reporter: deanis74, Assigned: aaronlev)
Details
Attachments
(1 file, 2 obsolete files)
1.50 KB,
patch
|
neil
:
review+
bryner
:
superreview+
|
Details | Diff | Splinter Review |
Steps:
1. Open the test case from bug 989 (attachment 59811 [details])
2. Press Alt+B
3. Watch radio1 select and get the focus indicator around it
4. Press Alt+C
Expected Results: radio2 is selected and gets the focus indicator
Actual Results: radio2 is selected but no focus indicator. If I press Alt+C
again, the focus indicator is drawn.
![]() |
||
Updated•23 years ago
|
QA Contact: madhur → rakeshmishra
![]() |
||
Updated•23 years ago
|
QA Contact: rakeshmishra → trix
Comment 1•22 years ago
|
||
I've just noticed that radio buttons never get focussed since at least 1.4
(although to be precise it's the radio group that should get focussed).
Assignee | ||
Updated•21 years ago
|
Assignee: jag → aaronleventhal
Assignee | ||
Comment 2•21 years ago
|
||
Assignee | ||
Updated•21 years ago
|
Attachment #150347 -
Flags: review?(neil.parkwaycc.co.uk)
Comment 3•21 years ago
|
||
Comment on attachment 150347 [details] [diff] [review]
For mouse down or focus event on a radio button, we need focus the radio group, then select the button
> <handler event="mousedown" button="0">
> <![CDATA[
>- if (!this.disabled)
>+ if (!this.disabled) {
>+ this.radioGroup.focus();
> this.radioGroup.focusedItem = this;
>+ }
>+ ]]>
>+ </handler>
I don't see why you need this change; clicking a radio button with the mouse
already focuses the group.
>+ <handler event="focus">
>+ <![CDATA[
>+ if (!this.disabled) {
>+ this.radioGroup.focus();
>+ this.radioGroup.focusedItem = this;
>+ }
> ]]>
> </handler>
> </handlers>
I'm not sure why you need to set the focused item but if you do you should set
it before focussing the group.
Attachment #150347 -
Flags: review?(neil.parkwaycc.co.uk) → review-
Assignee | ||
Comment 4•21 years ago
|
||
Why do we make it possible to have a different focusedItem and selectedItem? We
should ensure that they're the always same. That's just how radio buttons work
-- you focus a radio button and it gets selected. Likewise, you select a radio
button and if the group has focus, the radio button also gets focus. It stays in
sync.
(In reply to comment #3)
> (From update of attachment 150347 [details] [diff] [review])
> > <handler event="mousedown" button="0">
> > <![CDATA[
> >- if (!this.disabled)
> >+ if (!this.disabled) {
> >+ this.radioGroup.focus();
> > this.radioGroup.focusedItem = this;
> >+ }
> >+ ]]>
> >+ </handler>
> I don't see why you need this change; clicking a radio button with the mouse
> already focuses the group.
>
> >+ <handler event="focus">
> >+ <![CDATA[
> >+ if (!this.disabled) {
> >+ this.radioGroup.focus();
> >+ this.radioGroup.focusedItem = this;
> >+ }
> > ]]>
> > </handler>
> > </handlers>
> I'm not sure why you need to set the focused item but if you do you should set
> it before focussing the group.
>
Comment 5•21 years ago
|
||
(In reply to comment #4)
>Why do we make it possible to have a different focusedItem and selectedItem?
Because focus and selection happen on different events, for example,
Checkbox: mousedown becomes focused; mouseup becomes toggled.
Radio: mousedown becomes focused; mouseup becomes selected.
Assignee | ||
Comment 6•21 years ago
|
||
Actually in my mind focusedIndex and selectedIndex should be merged into one
variable.
Right now the esm code does this when an accesskey is fired on a xul:radio -
element->Focus();
element->Click();
In reality doing one or the other should also work. So, perhaps this patch
should be changed to either 1) set both selectedIndex and focusedIndex, and
then focus the group or 2) merge them into 1 variable.
Attachment #150347 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #150353 -
Flags: review?(neil.parkwaycc.co.uk)
Assignee | ||
Updated•21 years ago
|
Attachment #150353 -
Flags: review?(neil.parkwaycc.co.uk)
Assignee | ||
Comment 7•21 years ago
|
||
Attachment #150353 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #150359 -
Flags: review?(neil.parkwaycc.co.uk)
Comment 8•21 years ago
|
||
Comment on attachment 150359 [details] [diff] [review]
New patch setting focusedItem not selectedItem
Hmm... this file is nicely inconsistent as to whether to leave blank lines
between handlers...
Attachment #150359 -
Flags: review?(neil.parkwaycc.co.uk) → review+
Assignee | ||
Updated•21 years ago
|
Summary: Pressing access key for radio group doesn't focus if radio group has focus → Pressing access key for radio button doesn't focus radio group or show focus on radio button
Assignee | ||
Updated•21 years ago
|
Attachment #150359 -
Flags: superreview?(bryner)
Assignee | ||
Updated•21 years ago
|
Priority: -- → P1
![]() |
||
Comment 9•21 years ago
|
||
Comment on attachment 150359 [details] [diff] [review]
New patch setting focusedItem not selectedItem
sr=bryner
Attachment #150359 -
Flags: superreview?(bryner) → superreview+
Assignee | ||
Comment 10•21 years ago
|
||
Checking in xpfe/global/resources/content/bindings/radio.xml;
/cvsroot/mozilla/xpfe/global/resources/content/bindings/radio.xml,v <-- radio.xml
new revision: 1.33; previous revision: 1.32
done
Checking in toolkit/content/widgets/radio.xml;
/cvsroot/mozilla/toolkit/content/widgets/radio.xml,v <-- radio.xml
new revision: 1.7; previous revision: 1.6
done
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 11•21 years ago
|
||
Patch re-checked in
Checking in widgets/radio.xml;
/cvsroot/mozilla/toolkit/content/widgets/radio.xml,v <-- radio.xml
new revision: 1.13; previous revision: 1.12
done
Checking in nsWidgetStateManager.js;
/cvsroot/mozilla/toolkit/content/nsWidgetStateManager.js,v <--
nsWidgetStateManager.js
new revision: 1.10; previous revision: 1.9
done
Keywords: aviary-landing
Updated•21 years ago
|
Keywords: aviary-landing
Updated•7 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•