-
Notifications
You must be signed in to change notification settings - Fork 15.7k
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: setTopBrowserView focus issue with reordering #42653
Conversation
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.
nice catch!
@codebytere Thanks for the review! Are you able to help me merge it? Or let me know what else I should do to make the PR ready! |
Lint is unrelated, fixed in #42715 |
Release Notes Persisted
|
I have automatically backported this PR to "32-x-y", please check out #42733 |
I have automatically backported this PR to "31-x-y", please check out #42734 |
I have automatically backported this PR to "30-x-y", please check out #42735 |
Description of Change
fixes: #42637
Summary of bug
setTopBrowserView
, the view would focus correctly, and that is because it's using the macOS view ordering APIs to reorder the view to the top without reseting any state.setTopBrowserView
to:The issue arises because
this.addBrowserView
removes the view from the owner window before re-adding it. This removal removes the view from the focus list and resets its state, causing the top view to incorrectly focus.Proposed fix
AddChildViewAt
to reorder if the child is already a child of this view. So callingthis.contentView.addChildView
directly on a view that already exists on the window will reorder it to the top.Checklist
npm test
passesRelease Notes
Notes: Fixed a focus issue when calling
BrowserWindow.setTopBrowserView