Opened 15 years ago

Closed 14 years ago

Last modified 13 years ago

#5119 closed defect (fixed)

ColorPalette: Focus set on doc not on cell

Reported by: ptbrunet Owned by: simonjb
Priority: high Milestone: 1.1
Component: Dijit Version: 0.9
Keywords: Cc: [email protected]…, Becky Gibson
Blocked By: Blocking:


Go to .../dojotoolkit/dijit/tests/test_ColorPalette.html and set focus on the first cell, press ctrl tab twice to move focus away and back. The focus moves back to the first cell. Now move focus to some other cell and do the same thing, focus doesn't move to the orignal cell but instead to the document.

Attachments (1)

5119c.diff (10.6 KB) - added by simonjb 14 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 15 years ago by ptbrunet

This might be related: Go to the button test and put focus on one of the drop down menus (including the palette dropdown), press ctrl Tab twice, no focus is fired and pressing tab doesn't do anything.

comment:2 Changed 14 years ago by simonjb

Owner: set to simonjb

comment:3 Changed 14 years ago by simonjb

Status: newassigned

comment:4 Changed 14 years ago by ptbrunet

Ctrl Tab moves between tabs. I should have said Alt Tab in my opening comment - but the same issue exists with Ctrl Tab.

comment:5 Changed 14 years ago by simonjb

Cc: Becky Gibson added

I've been having a look at this. The ColorPalette dynamically sets tabindex="0" on the img cell with focus, rather than setting tabindex="0" on the ColorPalette widget and redirecting focus with focus() (as the menu and toolbar do). Moving to the menu and toolbar model will fix this bug. However, Firefox cannot focus() img elements with tabindex="-1". I have filed a bug against Mozilla:

Fixing the Mozilla bug won't really help us though as FF2 would not be fixed (I'm thinking). So, a possible solution would be to modify the ColorPalette such that the cell imgs are wrapped in a div, and focus the div.

comment:6 Changed 14 years ago by simonjb

Or, if it does get fixed in FF3 we could just live with the bug in FF2.

comment:7 Changed 14 years ago by Becky Gibson

I could live with this bug in FF2 as long as the color palette is still keyboard accessible, of course :-). Or, if we wrap the img elements with another element, could it be a span rather than a div since divs are now getting put in the a11y hierarchy? I didn't look at the code so there is probably some requirement (like sizing) for using a div).

Changed 14 years ago by simonjb

Attachment: 5119c.diff added

comment:8 Changed 14 years ago by simonjb

Resolution: fixed
Status: assignedclosed

(In [12831]) Wrap the ColorPalette? imgs in spans as Firefox cannot programmatically focus imgs with tabindex=-1; fixes #5119

comment:9 Changed 13 years ago by bill

(In [20780]) Big cleanup of ColorPalette code, fixing focus issues and rolling back most of #5119 as it missed the point that we should set tabIndex >= 0 on nodes that we focus. Fixes #10315, refs #5119 !strict.

Note: See TracTickets for help on using tickets.