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
ListView: OnSelectedChanged is called when it didn't actually change (OnEnter) #2140
Comments
Actually the item is only selected if the Enter key or double click was used. That why the item is never selected. The reason why the |
I do not understand you OR you are confused about how a list box is supposed to work. Moving up/down in a list box with keyboard should change the current selection. |
You are right, sorry. I was confused with the |
I don't understand, sorry. |
Suppose the last selected item was 3 and is saved to a variable. After the scenario listview is regenerated set the selected item with that variable. |
As I understand it, @tig is saying that Terminal.Gui/Terminal.Gui/Views/ListView.cs Lines 706 to 709 in af79010
@BDisp are you describing a scenario where having this call in OnEnter is important? To me it makes sense to remove it as system should be reporting a single action (i.e. Enter) and out of the box no selection changes when you Enter the control so firing But I do see the conditional of |
I don't understand the Let's step back to fundamentals and ensure we're on the same page:
In PR #1081, @BDisp added ** I believe this (setting @BDisp |
Well, that I know the
But I agree the subscriber can subscribe the |
@BDisp do you know what will break if we fix this bug and change |
I really don't know. Maybe the |
Fixes #2140. OnSelectedChange is being called from OnEnter when the selection didn't actually change.
Because of this, there's no way for an override to know if the selection REALLY changed.
In UI Catalog, this means that whenever the focus returns to the Category ListView, the Secenario ListView gets regenerated, causing IT to lose what Scenario was previously selected:
I believe the call to
OnSelectedChanged
inOnEnter
should be removed.@BDisp - what do you think?
The text was updated successfully, but these errors were encountered: