material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[LeftNav] Closing left-nav via keyboard when nested menu is open fails to close nested menu.

Open MrJoy opened this issue 11 years ago • 4 comments

  1. Open left nav that has a nested menu.
  2. Open the nested menu.
  3. Press esc to close the left nav.

Note that the nested menu is still visible.

This is on Chrome 39.0.2171.71 on OSX.

MrJoy avatar Dec 07 '14 17:12 MrJoy

A cursory examination of the code suggests that the problem is that _onParentItemClick isn't called in this codepath -- I.E. there's an implicit dependency in the left nav on the nested menu to maintain its own state properly. Perhaps centralizing state control into the left nav component would make it easier to manage complex cases?

MrJoy avatar Dec 07 '14 18:12 MrJoy

I think we have two options. First, make the NestedMenu WindowListenable to the ESC key just like left-nav. This does not centralize state control to the left-nav but it does provide the capability of closing nested menus without requiring the user to 'click off'. The second is to create a close() method in Menu that will close NestedMenus and then call this method from the close() of the left-nav.

Both solutions are nice; NestedMenus can be closed from the keyboard with the first and the second provides programmatic means of closing NestedMenus. I can't think of a use case for programmatic closing so I'm personally leaning towards option 1. Thoughts?

jkruder avatar Mar 21 '15 13:03 jkruder

This seems to be fixed now, right? @oliviertassinari

alitaheri avatar Dec 06 '15 11:12 alitaheri

I have just tested it. This seems to be fixed.

oliviertassinari avatar Dec 06 '15 11:12 oliviertassinari