Meteor-Community-Packages / meteor-autocomplete

Client/server autocompletion designed for Meteor's collections and reactivity.
https://atmospherejs.com/mizzao/autocomplete
MIT License
350 stars 109 forks source link

[REQUEST] contenteditable support? #60

Open fungilation opened 10 years ago

fungilation commented 10 years ago

Support for <div contenteditable> would be awesome.

mizzao commented 10 years ago

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

fungilation commented 10 years ago

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

mizzao commented 10 years ago

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.

benmgreene commented 9 years ago

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?

mizzao commented 9 years ago

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.