slint
slint copied to clipboard
ComboBox reset current value if current-index < 0
- This resets the
current-valueofComboboxif thecurrent-indexis< 0or>= model.length - Fixes #3628
- At the moment
current-valueisin-out, that could cases trouble because from outside you can set any string and also if it's not part of the list. I would suggest to change it to aoutproperty in the future but it will be a breaking change.
that could cases trouble because from outside you can set any string and also if it's not part of the list.
Yeah, i think this is indeed a dangerous change. I even wonder if we do not do that sometimes. So this would be a breaking change because when the binding is broken, the text and the value no longer adjust.
I guess this can't be fixed without the changed event.
I would suggest to change it to a out property in the future but it will be a breaking change.
Yeah, in retrospect it should have been out
Maybe we can come to a way to make the in deprecated as in out deprecated(in) property <string> value; (dummy syntax)
In particular, this would even break cargo-ui: https://github.com/slint-ui/cargo-ui/blob/10f77c902cdf9841331339558e9b685b325917ff/ui/cargo.slint#L331
In particular, this would even break cargo-ui: https://github.com/slint-ui/cargo-ui/blob/10f77c902cdf9841331339558e9b685b325917ff/ui/cargo.slint#L331
Then without change handlers I think it'S not possible to fix this situation without breaking.
Looks like this was done in https://github.com/slint-ui/slint/pull/5217 I guess this can be closed.