maui
maui copied to clipboard
[WinUI] First Entry gets focus when window is re-activated
Description
I have a stack layout with multiple expanders full of filter options. When the top expander with the entry box is expanded, and a user scrolls down, clicks another program (window) and clicks back to my application there seems to be logic that wants to auto-focus the first entry, which is at the top of the scrollview, and therefore the scrollview scrolls up this is unwanted behaviour as I want to keep the current scrollposition
This seems to be very much related to https://github.com/dotnet/maui/issues/11472 which was fixed. I would like to be able to disable ths auto-focus behaviour of my app.
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
9.0.70 SR7
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
No response
Affected platforms
Windows
Affected platform versions
No response
Did you find any workaround?
no
Relevant log output
We've found some similar issues:
- #11472 , similarity score: 83%
- #23911 , similarity score: 82%
If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.
Note: You can give me feedback by 👍 or 👎 this comment.
issues in this area make windows apps nearly unusable as some pages will just unexpectedly jump to the top as it hunts for a control to auto-focus to.
I've created a basic project that reproduces a similar issue, not exactly as described here but the end result is very close, so it likely is related - https://github.com/MitchBomcanhao/BugWindowsFocus run the app on a window, so that the entire layout doesn't fit and you have to scroll down.
My app has a first page with
- an editor
- an entry
- some empty space
- a button
- you type something in the entry, just to prove that focus is moved into the second item in the page.
- scroll down to the bottom of the page.
- you then click the button, which will navigate into a modal page.
- click the modal page's single button, which will pop that page.
- OBSERVE
- you find yourself back on the main page,
- the page has been scrolled back to the top
- focus has shifted to the first item in the page, the editor.
This issue has been verified in Visual Studio 17.14.0 Preview 4.0 with MAUI versions (8.0.100, 9.0.0, 9.0.70 & 9.0.80). It can be reproduced on Windows platform.