MassAutocomplete
MassAutocomplete copied to clipboard
Added a "display_on_attach" option.
This allows you to set true or false. If true it will show all available unfiltered items. If false it will not show any item until you start typing (like original).
Hey @dc-m, Thanks for the PR!
The diff is very hard to read (is it possible you formated the entire file?).
I left some comments but I might have missed some changes as all the file is marked as changed. If you could push an update that will highlight only the changes you made it will be much easier for me to review.
Sure I will do that when i get back from work tonight - sorry i CTRL + K + D and it must have caused a whole file reshift!
Apologies for the way I've done this.
I attempted to get it to only show my changes but each time I did it seems to just remove all the original and add all my file. So have commented where I have made changes
Hey David,
A more general approach would be "suggest_when_empty" option. This way you we can also address the situation where the user deleted all the text from the input and you want to trigger a suggest cycle to show some options.
If you set last_selected_value
to null in on_attach
for example, it will trigger a suggest cycle when you first focus the field (given that there is no value to the ngModel).
if (options.suggest_when_empty) {
// Set last value to something different than th initial value
// so the first suggest will trigger suggest.
last_selected_value = null;
}