stimulus-autocomplete
stimulus-autocomplete copied to clipboard
Multiselection
Hi,
Would you consider a multi-selection PR where a user selects multiple values from the dropdown;
Interesting. So that would add multiple ids, as array, to hidden field?
That is correct. Think about tagging for example; A user may wish to flag his post using one of the tags available in the database. Github does something similar with Labels I think.
So that would add multiple ids, as array, to hidden field?
That's the concept for now, yes. I still need to figure out how to style this thing but that's the idea. Each selected option should be removable and there should also be a master 'Cancel' button on the far right which would remove all selected options at once.
I think the groundwork is already done for this. What do you think?
I like it. I don't use this controller right now in a way that I would utilize it right away but may be somebody would. Tagging is good example.
hi, @kstratis, @pruzicka ! Any updates on it?
hi, @kstratis, @pruzicka ! Any updates on it?
Not from me mate, I've said I like it.
@Senegal I did some thinking over this and turns out it may not be as trivial as initially expected. I currently don't have the time to implement this let alone test and iterate. I'm leaving this open in case anybody else wants to pick it up.
FWIW I went with this library for now: https://github.com/snapappointments/bootstrap-select
UPDATE Another great option which I read about this week in javascript weekly seems to be tagify.
I've started spiking this on the multiselection branch. I don't think the multiselection itself will be too difficult to implement, but we'll probably have to provide some styles with sensible defaults so it's easy to use.