-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Is Combo() meant to return "true" even if current_item does not change? #1182
Comments
You are correct that at the moment, if you click the same option again it will return true. The consistent behaviour over widgets has been to do that, but it is certainly debatable. We could change/fix that. FYI the change would be turning:
Into
|
Great!, thanks. I have just started using it, so now I know what to expect in that particular case. If someone is using that true value as some sort of reload mechanism of whatever is selected, then the change could affect them significantly, so I can totally live with the way it works now :) |
The change is fairly sensible but I would have to think about the consequences on user codebases. |
In one of my projects I use combo as a navigation and if I select something already selected, the page refreshes. If the behaviour is changed, I can no longer do that. On the other hand if it stays the same I can still do |
Thanks Mikulas. Will leave it as is for now, took note that we could expose this behavior later/somehow. |
Sorry, I didn't know if I was meant to close this or not, then I saw Mikulas comment and re-opened it but I am happy with the answers. |
I have eventually pushed this change for consistency. Commit: a02315e. |
Hi,
I am trying out Combo, and it feels like I don't want to run code if the selected option does not change, but if I click on it, no matter what I choose I will always get true as return value.
A trivial change to the code saving current item at the top and checking at the very end does the job for me, but I was just wondering if this was the expected behavior and what was the rationale for it.
Just to clarify, I understand that when I click outside the combo it returns false, this question is only about clicking the same option that was selected before.
thanks!
Francisco
The text was updated successfully, but these errors were encountered: