-
Bug
-
Resolution: Cannot Reproduce
-
Normal
-
None
-
9.5.0.2
-
Firefox 86 on Linux Mint 20.1, probably any browser/platform
-
None
Steps to Reproduce
<combobox value="@bind(vm.someString)" selectedItem="@save(vm.someObject)" autodrop="true" model=".."/>
Enter text that matches exactly the label of an item. onChange fires multiple times,
- vm.setSomeObject(..) gets called with correct value of (auto-selected) item
- vm.setSomeString(..) gets called with correct text from textbox
- vm.setSomeObject(..) gets called again with null value, which is wrong. Reason is that in org.zkoss.bind.converter.sys.ComboboxSelectedItemConverter:87, the selection is empty as it is not synced correctly/cleared again/whatever
Current Result
vm.setSomeObject(..) gets called with null value even though it was previously called with correct value
Expected Result
vm.setSomeObject(..) should be called only once with correct value as selected (implicitly) by entering the label text. Note: when clicking the comboitem, everything is fine
Debug Information
Workaround
Add onChange listener with prio=100 and set matching comboitem via code (and selection in model accordingly), very bad (yet working) solution.