-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
if I use a combobox with a backing listmodel for the dropdown menu it always corrects the spelling of the entered Text accoriding to its items. E.g. the model contains "abc". But if I enter "Abc" or "ABC" it gets changed to "abc". Is there a way to disable this behaviour temporarely and force the combobox to accept a different capitalization of words? This behaviour does not depent on the settings of autodrop or autocomplete. However you can test this behaviour in your the combobox demo www.zkoss.org/zkdemo/combobox/autocomplete. I would like to have a key combination, e.g. pressing ESC, that forces the combobox to accept whatever text is inside without correcting it.
Thank you,
All the best Leo
Hey there,
The behavior you describe is actually caused by autocomplete.
The way autocomplete works is as follow: after typing a letter into the the combobox, the combobox will search the existing comboitems. If it finds at least one comboitem that starts with the same string as the input value (not case sensitive), it will mark that comboitem as selected, and replace the content of the input with the content of the target item's label.
If you set autocomplete to false, the combobox will not automatically fill the input with the label of the first search result, which allows the user to type a string with a different capitalization.
See the difference here: https://zkfiddle.org/sample/1u2s3n0/7-Another-new-ZK-fiddle
if you try to type: "e" (wait for popup to display items) then "N", the value will be autocompleted to en_US in the first one, but will receive just eN in the 2nd case.
Now in the "what can you do about this" section: What would you like to happen? ZK is very customizable. If the intent is to only autocomplete on exact case-sensitive strings, that would be a customizable option.
Here's a fiddle that shows an override to the combobox class which force cases-sensitiveness to completion https://zkfiddle.org/sample/3jl0gdt/2-Combobox-disable-case-completion
Note: this override is global (it affects all comboboxes that will be created in that page). If you want a granular approach to set that behavior on some combobox and not other, the same logic can be used but using an extended class instead.
Asked: 2023-07-05 14:17:16 +0800
Seen: 5 times
Last updated: Jul 08
bug with intboxes on mobile devices
zk keikai-how to add custom button/label to formulabar?
zk-keikai- update multiple cells parallel at same time asynchronously
zk-keikai-How to auto fit column width based on text
zk-keikai-ClipboardPateEvent-called twice
Reference a spring bean from VariableResolver