Closed howudodat closed 3 months ago
I guess the reason behind this issue is that you didnt add the missing entry/value provider for the suggestions store, like this
LocalSuggestionsStore<String, SpanElement, SuggestOption<String>> localStore = LocalSuggestionsStore.<String, SpanElement, SuggestOption<String>>create()
.addSuggestion(SuggestOption.create("Ahmad bawaneh"))
.addSuggestion(SuggestOption.create("Ahmad Ali"))
.addSuggestion(SuggestOption.create("Ali omar"))
.addSuggestion(SuggestOption.create("Ali hasan"))
.addSuggestion(SuggestOption.create("Schroeder Coleman"))
.addSuggestion(SuggestOption.create("Renee Mcintyre"))
.addSuggestion(SuggestOption.create("Casey Garza"))
.setMissingEntryProvider(inputValue -> Optional.of(SuggestOption.create(inputValue)))
.setMissingValueProvider(missingValue -> Optional.of(SuggestOption.create(missingValue)));
I dont want it to create new items, I am only using this as a filterable select
I dont want it to create new items, I am only using this as a filterable select
It is not about creating a new Item, but since a suggest box can have any type of value, not only strings it is internally deals with suggest options, and it assumes that in case a string value is entered then it need to be converted to a type supported by the suggest box value.
Still I guess clearing the text value of the input element either way wont be an issue.
There's two problems with this code:
if I have typed, but not selected an option, there wont be a selected option so delete wont clear anything
additionally, even though I have selected an item (and get the notification for it), selectedOption is still null