diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-06-25 11:59:35 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-06-25 11:59:35 -0400 |
commit | ab39099f665433ce88ed2310323b890e44eab6b9 (patch) | |
tree | 35a98b28fe7cd4f175feec484071b02138e93d65 /ui/jquery.ui.autocomplete.js | |
parent | 405cbefe5cf0b6b381ae19242f4770f2ffc4c1a0 (diff) | |
download | jquery-ui-ab39099f665433ce88ed2310323b890e44eab6b9.tar.gz jquery-ui-ab39099f665433ce88ed2310323b890e44eab6b9.zip |
Autocomplete: More verbose checking for multi-line to work around IE treating inputs as contentEditable.
Diffstat (limited to 'ui/jquery.ui.autocomplete.js')
-rw-r--r-- | ui/jquery.ui.autocomplete.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 665cf2066..b8d86644c 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -55,7 +55,7 @@ $.widget( "ui.autocomplete", { // search term. #7799 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.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() { var array, url, that = this; |