]> source.dussan.org Git - jquery-ui.git/commit
Draggable: Fix spurious blur in dialogs on mousedown
authorRyan Oriecuia <ryan.oriecuia@visioncritical.com>
Tue, 16 Aug 2016 23:52:15 +0000 (16:52 -0700)
committerScott González <scott.gonzalez@gmail.com>
Tue, 13 Sep 2016 12:53:00 +0000 (08:53 -0400)
commit8c66934434214ab92cbcf46240beb739154fdfbf
tree7658773c0a719c533cb48325aae48586c2c0b526
parent51461d523868c168f2e12eeb547c1cf8b7cf59cf
Draggable: Fix spurious blur in dialogs on mousedown

I was running into a problem with a popup menu control in a dialog; clicks
weren't working (but keyboard was working fine). It turned out that the menu
was getting destroyed before the click event could fire.

Tracked down the issue to the way draggable blurs focused controls; it was
doing the blur before it ran through the logic to figure out if the drag was
actually on the handle. I've moved the blur below these checks, so it'll only
blur things if it actually needs to handle the drag. Otherwise, it asserts no
opinion on what should and shouldn't be focused, which seems like the way
things ought to be.

Also, added a unit test to check for the expected behavior.

Fixes #15046
Closes gh-1730
tests/unit/draggable/core.js
ui/widgets/draggable.js