tom-select
tom-select copied to clipboard
[Bug]: option displayed is the default one when default option have the same value as the one selected
Bug description
When a default option has the same value has another option that is selected, the default one is displayed instead of the one selected.
This can be encountered when using select as facets and the option values are URL to sort a list. When an option is selected, the page is reload, and the selected option has the same value as the default option so when we click on it removes the facet.
Expected behavior
Even if there are some workarounds for this situation, selected option should take the priority over other options that have the same value and that are not selected.
Steps to reproduce
I have a codesandbox with 4 examples. The n°3 one is my issue. https://codesandbox.io/p/sandbox/gxvyd3
Additional context
- Browser [Every browser]