]> source.dussan.org Git - jquery-ui.git/commitdiff
Spinner: Don't stop propagation for keydown events.
authorScott González <scott.gonzalez@gmail.com>
Sat, 6 Aug 2011 16:49:11 +0000 (12:49 -0400)
committerScott González <scott.gonzalez@gmail.com>
Sat, 6 Aug 2011 16:49:11 +0000 (12:49 -0400)
ui/jquery.ui.spinner.js

index 20c8d5e3df6d2d8080b7e613e900c421dd44381f..47fb3e6f739834b708b544e96258ef75525134a8 100644 (file)
@@ -66,9 +66,8 @@ $.widget( "ui.spinner", {
                this.element.attr( "role", "spinbutton" );
                this._bind({
                        keydown: function( event ) {
-                               if ( this._start( event ) ) {
-                                       // TODO: don't stop propagation
-                                       return this._keydown( event );
+                               if ( this._start( event ) && this._keydown( event ) ) {
+                                       event.preventDefault();
                                }
                        },
                        keyup: function( event ) {
@@ -144,21 +143,21 @@ $.widget( "ui.spinner", {
                switch ( event.keyCode ) {
                case keyCode.UP:
                        this._repeat( null, 1, event );
-                       return false;
+                       return true;
                case keyCode.DOWN:
                        this._repeat( null, -1, event );
-                       return false;
+                       return true;
                case keyCode.PAGE_UP:
                        this._repeat( null, options.page, event );
-                       return false;
+                       return true;
                case keyCode.PAGE_DOWN:
                        this._repeat( null, -options.page, event );
-                       return false;
+                       return true;
                case keyCode.ENTER:
                        this.value( this.element.val() );
                }
 
-               return true;
+               return false;
        },
 
        _mousewheel: function() {