slint icon indicating copy to clipboard operation
slint copied to clipboard

ComboBox reset current value if current-index < 0

Open FloVanGH opened this issue 2 years ago • 4 comments

  • This resets the current-value of Combobox if the current-index is < 0 or >= model.length
  • Fixes #3628
  • At the moment current-value is in-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 a out property in the future but it will be a breaking change.

FloVanGH avatar Oct 10 '23 05:10 FloVanGH

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)

ogoffart avatar Oct 10 '23 07:10 ogoffart

In particular, this would even break cargo-ui: https://github.com/slint-ui/cargo-ui/blob/10f77c902cdf9841331339558e9b685b325917ff/ui/cargo.slint#L331

ogoffart avatar Oct 10 '23 09:10 ogoffart

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.

FloVanGH avatar Oct 10 '23 09:10 FloVanGH

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 20 '24 13:06 CLAassistant

Looks like this was done in https://github.com/slint-ui/slint/pull/5217 I guess this can be closed.

ogoffart avatar Jul 29 '25 08:07 ogoffart