Open fungilation opened 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!
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
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.
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?
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.
Support for
<div contenteditable>
would be awesome.