Skip to main content

Search and Top Navigation

#8929 closed bug (fixed)

Opened December 20, 2012 06:56PM UTC

Closed August 12, 2013 12:12AM UTC

Last modified December 16, 2013 02:07PM UTC

Menu needs adjustement for use in Selectmenu

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

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

Attachments (0)
Change History (12)

Changed January 02, 2013 04:49PM UTC by scottgonzalez comment:1

milestone: 1.10.0git
status: newopen

Changed July 15, 2013 04:52AM UTC by k_borchers comment:2

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?

Changed July 17, 2013 10:04PM UTC by fnagel comment:3

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

Changed July 18, 2013 10:55AM UTC by jzaefferer comment:4

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]."

Changed July 18, 2013 10:58AM UTC by jzaefferer comment:5

description: 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.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

Changed July 18, 2013 12:17PM UTC by scottgonzalez comment:6

I can't see this being used outside of the creation of a new widget. Can we just move the conditional from inside the document click handler to a separate function and let selectmenu override that? I'd only want the conditional moved since the resetting of this.mouseHandled should still occur.

Changed July 20, 2013 12:57AM UTC by fnagel comment:7

The patch works pretty nice.

Why not add a var similar to this.delay?

Changed July 23, 2013 01:26PM UTC by jzaefferer comment:8

Can we just move the conditional from inside the document click handler to a separate function and let selectmenu override that?

Sounds good to me. Kris, can you implement that?

Btw. it may be a good idea to land the change in master first, merge that to selectmenu, and apply the second commit there. Or figure out how git behaves when you merge a branch that contains a cherry-picked commit.

Changed August 12, 2013 12:12AM UTC by Kris Borchers comment:9

resolution: → fixed
status: openclosed

Menu: Make check for click outside of menu a function which can be overridden. Fixes #8929 - Menu needs adjustement for use in Selectmenu

Changeset: cceb163548eea78525a3a60ada95a5af6e3ddf25

Changed November 26, 2013 07:51PM UTC by Kris Borchers comment:10

Menu: Make check for click outside of menu a function which can be overridden. Fixes #8929 - Menu needs adjustement for use in Selectmenu

(cherry picked from commit cceb163548eea78525a3a60ada95a5af6e3ddf25)

Changeset: 2a7896ec3eac09aa13fc6e0f8bf8316e7985387e

Changed December 16, 2013 02:07PM UTC by Scott González comment:11

Revert "Menu: Make check for click outside of menu a function which can be overridden. Fixes #8929 - Menu needs adjustement for use in Selectmenu"

This reverts commit 2a7896ec3eac09aa13fc6e0f8bf8316e7985387e.

Changeset: 2135008d2cf7c4a706ce641349db86eee7cf86ce

Changed December 16, 2013 02:07PM UTC by scottgonzalez comment:12

Reverted from 1-10-stable since this is an API change.