Opened 12 years ago

Closed 12 years ago

#4927 closed defect (fixed)

clicking on a menu separator and moving off it causes error

Reported by: simonjb Owned by: Becky Gibson
Priority: high Milestone: 1.0
Component: Accessibility Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

To reproduce:

  1. open dijit/tests/test_Menu.html
  2. right click to open a menu
  3. click on a menu separator
  4. move the mouse off the separator
  5. error: item._blur is not a function

I think this is probably a bug in dijit._KeyNavContainer -- when a child is added to the container its tabindex is set to -1. The separator should have no tabindex.

Attachments (2)

4927.patch (1.0 KB) - added by Becky Gibson 12 years ago.
add isFocusable override to menuseparator and toolbarseparator to return false
4927a.patch (1.5 KB) - added by Becky Gibson 12 years ago.
added check for widget.isFocusable() in _onContainerFocus()

Download all attachments as: .zip

Change History (5)

Changed 12 years ago by Becky Gibson

Attachment: 4927.patch added

add isFocusable override to menuseparator and toolbarseparator to return false

comment:1 Changed 12 years ago by Becky Gibson

Status: newassigned

4927.patch just adds an inFocusable() override to MenuSeparator? and ToolbarSeparator? to always return false. This prevents those widgets from getting selected via the mouse.

Changed 12 years ago by Becky Gibson

Attachment: 4927a.patch added

added check for widget.isFocusable() in _onContainerFocus()

comment:2 Changed 12 years ago by Becky Gibson

updated patch to not allow lastFocused to get set to a separator widget in _onContainerFocus. Really shouldn't be allowing children that shouldn't be focused to get assigned tabindex=-1 but that seemed like too risky a fix this close to shipping 1.0. Because of the tabindex=-1 on the menuseparator, it was getting focus via a mouse click and set as the lastFocused item. With this fix, the menuseparator will still be given focus by Firefox if user clicks on it, but it won't be remembered as the lastFocused item and thus we won't try to call _onBlur on it when the menu popup loses focus (but we will be calling _onBlur on whatever menu item was last focused). This seems to be ok - I checked that the item that had focus before the menu was opened has focus again when the menu that has focus on a separator is closed via escape.

comment:3 Changed 12 years ago by Becky Gibson

Resolution: fixed
Status: assignedclosed

(In [11189]) fixes #4927. Added isFocusable(){return false;} to MenuSeparator? and ToolbarSeparator? widgets. In _onContainerFocus in _container.js check for isFocusable before updating this.lastFocused. Prevents error in Menu code. Needs a more thorough fix for 1.1 -submitted #4933 to cover that.

Note: See TracTickets for help on using tickets.