-
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
Improve FocusBehavior: support list view lazy render. support control x:load #4099
Conversation
Thanks lyf6lyf for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
|
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.
Just a small comment, but otherwise it looks good.
// The list may not have any item yet, we wait until the first item is rendered. | ||
listViewBase.ContainerContentChanging -= OnContainerContentChanging; | ||
listViewBase.ContainerContentChanging += OnContainerContentChanging; | ||
listViewBaseControls++; |
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.
It seems like a flag should be fine instead of counter.
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.
Thanks, I've push the fix in the new commit.
This PR has been marked as "needs attention 👋" and awaiting a response from the team. |
Hello @michael-hawker! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Bug fix confirmed. Unfortunately, though, I was unable to get the (populated) ListView to receive focus, with these changes. |
@XAML-Knight It works fine on my side. could you try to increase the timeout? |
Hi @lyf6lyf , I tried increasing the timeout, but still couldn't get the ListView (or any item in the ListView) to capture focus. |
Fixes
PR Type
What kind of change does this PR introduce?
Bugfix
Feature
What is the current behavior?
The App will crash (throws an
NullPointerException
) if we put a control whosex:Load = False
intoFocusBehavior
list.The App won't focus on a ListView items when they are deferred rendering.
What is the new behavior?
The App won't crash in above case.
The deferred item will get focus when it is loaded.
The
ListView
will get focus when its item is rendered.PR Checklist
Please check if your PR fulfills the following requirements:
Other information