Allow textcomplete to work on inputs (PR also filed upstream)
This commit is contained in:
		| @@ -124,8 +124,9 @@ if (typeof jQuery === 'undefined') { | ||||
|     this.views      = []; | ||||
|     this.option     = $.extend({}, Completer._getDefaults(), option); | ||||
|  | ||||
|     if (!this.$el.is('textarea') && !element.isContentEditable && element.contentEditable != 'true') { | ||||
|       throw new Error('textcomplete must be called on a Textarea or a ContentEditable.'); | ||||
|  | ||||
|     if (!this.$el.is('input[type=text]') && !this.$el.is('textarea') && !element.isContentEditable && element.contentEditable != 'true') { | ||||
|       throw new Error('textcomplete must be called on a input[type=text], Textarea or a ContentEditable.'); | ||||
|     } | ||||
|  | ||||
|     if (element === document.activeElement) { | ||||
| @@ -171,7 +172,7 @@ if (typeof jQuery === 'undefined') { | ||||
|       if (this.option.adapter) { | ||||
|         Adapter = this.option.adapter; | ||||
|       } else { | ||||
|         if (this.$el.is('textarea')) { | ||||
|         if (this.$el.is('textarea') || this.$el.is('input[type=text]')) { | ||||
|           viewName = typeof element.selectionEnd === 'number' ? 'Textarea' : 'IETextarea'; | ||||
|         } else { | ||||
|           viewName = 'ContentEditable'; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user