Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComboBox reset current value if current-index < 0 #3632

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FloVanGH
Copy link
Member

  • This resets the current-value of Combobox if the current-index is < 0 or >= model.length
  • Fixes [ComboBox] setting index to -1 does not clear ComboBox text #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.

@ogoffart
Copy link
Member

ogoffart commented Oct 10, 2023

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
Copy link
Member

@FloVanGH
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ComboBox] setting index to -1 does not clear ComboBox text
2 participants