aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--library/jquery-textcomplete/jquery.textcomplete.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/library/jquery-textcomplete/jquery.textcomplete.js b/library/jquery-textcomplete/jquery.textcomplete.js
index 1e61683ea..c8303eaa0 100644
--- a/library/jquery-textcomplete/jquery.textcomplete.js
+++ b/library/jquery-textcomplete/jquery.textcomplete.js
@@ -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';