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 🙌 |
|
|
Rosuavio
left a comment
There was a problem hiding this comment.
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.
It seems like a flag should be fine instead of counter.
There was a problem hiding this comment.
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 = FalseintoFocusBehaviorlist.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
ListViewwill get focus when its item is rendered.PR Checklist
Please check if your PR fulfills the following requirements:
Other information