mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +00:00
Autocomplete: More verbose checking for multi-line to work around IE treating inputs as contentEditable.
This commit is contained in:
parent
405cbefe5c
commit
ab39099f66
16
ui/jquery.ui.autocomplete.js
vendored
16
ui/jquery.ui.autocomplete.js
vendored
@ -55,7 +55,7 @@ $.widget( "ui.autocomplete", {
|
|||||||
// search term. #7799
|
// search term. #7799
|
||||||
var suppressKeyPress, suppressKeyPressRepeat, suppressInput;
|
var suppressKeyPress, suppressKeyPressRepeat, suppressInput;
|
||||||
|
|
||||||
this.isMultiLine = this.element.is( "textarea" ) || this.element.prop( "isContentEditable" );
|
this.isMultiLine = this._isMultiLine();
|
||||||
this.valueMethod = this.element[ this.element.is( "input,textarea" ) ? "val" : "text" ];
|
this.valueMethod = this.element[ this.element.is( "input,textarea" ) ? "val" : "text" ];
|
||||||
this.isNewMenu = true;
|
this.isNewMenu = true;
|
||||||
|
|
||||||
@ -326,6 +326,20 @@ $.widget( "ui.autocomplete", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_isMultiLine: function() {
|
||||||
|
// Textareas are always multi-line
|
||||||
|
if ( this.element.is( "textarea" ) ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// Inputs are always single-line, even if inside a contentEditable element
|
||||||
|
// IE also treats inputs as contentEditable
|
||||||
|
if ( this.element.is( "input" ) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// All other element types are determined by whether or not they're contentEditable
|
||||||
|
return this.element.prop( "isContentEditable" );
|
||||||
|
},
|
||||||
|
|
||||||
_initSource: function() {
|
_initSource: function() {
|
||||||
var array, url,
|
var array, url,
|
||||||
that = this;
|
that = this;
|
||||||
|
Loading…
Reference in New Issue
Block a user