bootstrap-tagautocomplete icon indicating copy to clipboard operation
bootstrap-tagautocomplete copied to clipboard

Doesn't work with textarea

Open mludowise opened this issue 10 years ago • 3 comments

The modifications made to bootstrap-typeahead.js don't allow it to work in a textarea but only an input or contenteditable element.

Line 86 should be:

this.query = this.$element.is("input") || this.$element.is("textarea") ? this.$element.val() : this.$element.text();

mludowise avatar Jul 03 '14 00:07 mludowise

If you send in a pull request, I'd be happy to merge it in.

zawaideh avatar Jul 04 '14 16:07 zawaideh

was this modification successful? doesn't appear to resolve the textarea issue for me.

DanPillay avatar Aug 10 '14 08:08 DanPillay

Sadly, it doesn't quite work. Allowing the typeahead to operate on a textarea just makes it function as if the textarea was an input field. So if you type, say "Say hello to @rober" it doesn't try to search for a match for @rober, it tries to search for a complete match to "Say hello to @rober". I don't know how the behavior works for contenteditable divs, but it doesn't work for textareas in the same manner, even once textareas are allowed by the change above.

tchalvak avatar Mar 19 '15 14:03 tchalvak