-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix clicking on empty part of widget.List not unfocusing #5314
base: develop
Are you sure you want to change the base?
Conversation
…cus other widgets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the driver internals well enough to comment on the approach in question but this does seem to fix the issue and the code looks good to me. Would you mind adding a test case for this?
@@ -130,6 +130,8 @@ func (l *List) RefreshItem(id ListItemID) { | |||
return | |||
} | |||
l.BaseWidget.Refresh() | |||
|
|||
l.Unselect(id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like an unrelated change? Why are the semantics of RefreshItem changing to that you can't use it to refresh a selected item?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- When the entry is focused, the list item should be unfocused, to unfocus the list item we need this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this code is not allowing an item to remain selected when it is refreshed - so scrolling will lose the selected status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry but this breaks driver event propagation as described in my feedback
I don't think a driver change is the right way to solve this. |
A little note on PR naming: Please avoid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks to be doing the opposite of what the code specifies, is this a mistake?
With a unit test we would be able to verify this corrected behaviour.
if l.focused { | ||
l.FocusLost() | ||
} | ||
canvas.Focus(l) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the PR says it is unfocusing but this code shows focussing - is this correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the PR says it is unfocusing but this code shows focussing - is this correct?
when the empty portion is clicked the widgets (Entry, list items) are getting unfocused --> the issue
This PR resolves this issue --> The widgets get unfocused when we click the empty portion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we should do this by unfocusing surely?
Focusing something else fixes it as a side-effect, not by actually fixing the issue!
@@ -130,6 +130,8 @@ func (l *List) RefreshItem(id ListItemID) { | |||
return | |||
} | |||
l.BaseWidget.Refresh() | |||
|
|||
l.Unselect(id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this code is not allowing an item to remain selected when it is refreshed - so scrolling will lose the selected status
Description:
This PR fixes the issue where clicking on an empty part of the widget list does not unfocus other widgets.
Fixes #4770
Checklist: