_create: function() {
var self = this,
doc = this.element[ 0 ].ownerDocument,
+ // Some browsers only repeat keydown events, not keypress events,
+ // so we use the suppressKeyPress flag to determine if we've already
+ // handled the keydown event. #7269
+ // Unfortunately the code for & in keypress is the same as the up arrow,
+ // so we use the suppressKeyPressRepeat flag to avoid handling keypress
+ // events when we know the keydown event was used to modify the
+ // search term. #7799
suppressKeyPress,
+ suppressKeyPressRepeat,
suppressInput;
this.valueMethod = this.element[ this.element.is( "input,textarea" ) ? "val" : "text" ];
if ( self.options.disabled || self.element.prop( "readOnly" ) ) {
suppressKeyPress = true;
suppressInput = true;
+ suppressKeyPressRepeat = true;
return;
}
suppressKeyPress = false;
suppressInput = false;
+ suppressKeyPressRepeat = false;
var keyCode = $.ui.keyCode;
switch( event.keyCode ) {
case keyCode.PAGE_UP:
}
break;
default:
+ suppressKeyPressRepeat = true;
// search timeout should be triggered before the input value is changed
self._searchTimeout( event );
break;
event.preventDefault();
return;
}
+ if ( suppressKeyPressRepeat ) {
+ return;
+ }
// replicate some key handlers to allow them to repeat in Firefox and Opera
var keyCode = $.ui.keyCode;