]> source.dussan.org Git - jquery-ui.git/commitdiff
Selectmenu: Preserve text selection when interacting with the widget
authorScott González <scott.gonzalez@gmail.com>
Tue, 29 Jul 2014 13:48:04 +0000 (09:48 -0400)
committerScott González <scott.gonzalez@gmail.com>
Tue, 29 Jul 2014 17:19:28 +0000 (13:19 -0400)
Fixes #10144
Closes gh-1295

ui/selectmenu.js

index 0b47feb534080281073822221c1f0485beb0ca14..a3d4281a6f32bc161ffa77939839484b403af44a 100644 (file)
@@ -355,7 +355,14 @@ return $.widget( "ui.selectmenu", {
        },
 
        _buttonEvents: {
+
+               // Prevent text selection from being reset when interacting with the selectmenu (#10144)
+               mousedown: function( event ) {
+                       event.preventDefault();
+               },
+
                click: "_toggle",
+
                keydown: function( event ) {
                        var preventDefault = true;
                        switch ( event.keyCode ) {