Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#10527 closed bug (fixed)

Draggable: Can't select option in modal dialog (IE8)

Reported by: grea Owned by:
Priority: minor Milestone: 1.11.2
Component: ui.draggable Version: 1.11.0
Keywords: regression Cc:
Blocked by: Blocking:

Description

The bug only appears in a modal dialog (jQuery UI 1.11 + IE8). Start typing the word and select it with the mouse. Option is not selected. If you make a long press of the mouse on the menu item, the list will disappear before the event mouseup http://jsbin.com/igeqam/75/edit

Change History (12)

comment:1 Changed 9 years ago by tj.vantoll

Keywords: regression added
Status: newopen
Summary: Mouse not select autocomplete in modal dialog (IE8)Autocomplete: Can't select option in modal dialog (IE8)

Confirmed against master. This works in 1.10.4, IE9, and non-modal dialogs.

So this is indeed specific to modal dialogs in IE8 with 1.11.

comment:2 Changed 9 years ago by tj.vantoll

Component: ui.autocompleteui.draggable
Summary: Autocomplete: Can't select option in modal dialog (IE8)Draggable: Can't select option in modal dialog (IE8)

I tracked this down to a $( document.activeElement ).blur() call in draggable (see https://github.com/jquery/jquery-ui/blob/2d03839c07a33d14ec7b31b2d4290a8ce6fc0cef/ui/draggable.js#L108), that was introduced in https://github.com/jquery/jquery-ui/commit/fcd1cafac8afe3a947676ec018e844eeada5b9de#diff-d41d8cd98f00b204e9800998ecf8427e.

In Chrome and IE8 the activeElement is set to the <input>, but because IE8—in its infinite wisdom—handles blur calls synchronously, the menu gets closed immediately and the mouse click event never gets to the autocomplete widget. Adding a setTimeout fixes the issue, but it crushes my soul a little to add another level of complexity to an already insane block of code—nevertheless I shall. Forgive me internet. Forgive me.

comment:4 Changed 9 years ago by mikesherov

Just an update. tj.vantoll and I discovered the true caus eof the bug, which he's working on.

comment:6 Changed 9 years ago by TJ VanToll

Resolution: fixed
Status: openclosed

Draggable: Only blur the focused element if the event occurs on a handle

Fixes #10527

Changeset: 075421d6d965c66055e47cde477f0ce2e23f1755

comment:7 Changed 9 years ago by Mike Sherov

Draggable: Only focus the draggable if the event occurs on a handle

Refs #10527

Changeset: d10440fe44c840dd5c69c4efb1c06d2636fa11c6

comment:8 Changed 9 years ago by mikesherov

Milestone: none1.11.2

comment:9 Changed 9 years ago by mikesherov

#10230 is a duplicate of this ticket.

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

#10567 is a duplicate of this ticket.

comment:11 Changed 9 years ago by Scott González

#10591 is a duplicate of this ticket.

comment:12 Changed 9 years ago by tj.vantoll

#10592 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.