Improve popup box keyboard control#865
Improve popup box keyboard control#865miketoon wants to merge 1 commit intojuce-framework:masterfrom
Conversation
|
I think this feature makes sense, but I'm not sure about the implementation. It's valid for a popup menu to have multiple ticked items (for example if it's created as a window menu, rather than a combobox dropdown) so I don't think it makes sense to use the 'ticked' state to set the initial selection. To see what I'm talking about, apply this patch and run the 'Menus Demo' in the DemoRunner. In this case, we probably don't want the ticked items to be selected as soon as the menu opens. My preference would be to add an 'initially selected item' member to Do you think a solution like that would work for you? |
8b96e91 to
afd4a9c
Compare
|
yep that works. i've pushed a change to this branch which implements that. |
|
I've added this in d62d3aa. Hopefully this works for you, please let me know if there are any issues. |
Set ticked/selected item as highlighted on menu construction and
prevent fake mouse events from resetting this.
Previously when a menu was opened with the enter key a user would have to press escape key to close the menu. This was inconsistent if the selected/ticked item was highlighted using the arrow keys and then enter pressed.
Also previosuly keyboard navigation would start at the top/bottom of the list depending on whether up/down was pressed but this change uses the ticked/selected item as the start point.