Opened 10 years ago

Last modified 9 years ago

#8929 closed bug

Menu needs adjustement for use in Selectmenu — at Version 5

Reported by: Felix Nagel Owned by:
Priority: minor Milestone: git
Component: ui.menu Version: git (not yet released)
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by Jörn Zaefferer)

Selectmenu utilizes Menu to render its option list. When selectmenu is opened the selected item looses focus after 300ms. This is a usability problem which is currently fixed by changing this.delay in the Menu instance.

Problem is the collapseAll call on document click (create method) and the following blur event. I would remove that on click event but the mouseHandled reset is needed.

Detailed bug report by joshuahiggins: https://github.com/jquery/jquery-ui/issues/492#issuecomment-9994772

More info about the current fix in selectmenu: https://github.com/jquery/jquery-ui/pull/492/files#r2266217

I assume kborchers should look into this.

PR from Kris: https://github.com/jquery/jquery-ui/pull/1031

Change History (5)

comment:1 Changed 10 years ago by Scott González

Milestone: 1.10.0git
Status: newopen

comment:2 Changed 9 years ago by k_borchers

So I've been thinking about this for a bit and the solutions I have thought might work almost all involve a new option in which I don't like. The other thing I thought about was maybe making the delay configurable and setting a delay to false would effectively set the delay to 0 but also prevent the collapseAll when clicking outside of the menu. This would allow Selectmenu to handle the menu hiding, etc. but keep the selected item highlighted. Thoughts?

comment:3 Changed 9 years ago by Felix Nagel

We'll see if it works out but it definitely sounds promising. Does this need a lot of changes on Menu side?

comment:4 Changed 9 years ago by Jörn Zaefferer

The delay property is used in multiple places. Would the check for a boolean-false be in all of them? Or just inside the document-click handler?

If that works (either way), how about making the delay property an option and documenting it? "Configure the delay for auto-closing submenus. Set to false to prevent the auto-closing[ on clicks outside the menu]."

comment:5 Changed 9 years ago by Jörn Zaefferer

Description: modified (diff)
Note: See TracTickets for help on using tickets.