meteor-autocomplete icon indicating copy to clipboard operation
meteor-autocomplete copied to clipboard

[REQUEST] contenteditable support?

Open fungilation opened this issue 11 years ago • 5 comments

Support for <div contenteditable> would be awesome.

fungilation avatar Sep 04 '14 20:09 fungilation

This would require some extensive modifications to the current system, but you're welcome to discuss it here and even implement it!

mizzao avatar Sep 04 '14 21:09 mizzao

Ok. For references, there's https://github.com/Sandglaz/bootstrap-tagautocomplete, "A bootstrap plugin to autocomplete tags for contenteditable div elements". It uses a fork of typeahead.js

fungilation avatar Sep 04 '14 22:09 fungilation

The whole reason I implemented this instead of typeahead is because an autocomplete system that is agnostic to Meteor's collections and reactivity would necessarily be more inefficient, having to rely on static arrays as input sources and being much more limited in rendering options.

Thanks for the suggestions, but due to my time constraints, someone else will probably have to implement this - at least in the near future.

mizzao avatar Sep 05 '14 03:09 mizzao

I wonder how hard this really would be to implement -- not being able to style the autocompleted content is a real weakness for me. @mizzao, would it be much more complicated than wrapping the rule-matching/autocompleted content with a span tag? I imagine we'd want to add a name or class parameter to the rule specific options, and maybe also a value field name option to set a non-text data-value on the span. Anything else I'm missing?

benmgreene avatar Sep 24 '14 15:09 benmgreene

I have no experience working with HTML contenteditables. It seems like there are way too many options to support the general case. Perhaps we could factor out the autocomplete logic for people that want to write their own - you'd just have to pass the current string, and the cursor position.

mizzao avatar Sep 24 '14 16:09 mizzao