You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
Whenever addChildView is called to add a WebContentsView to an existing BaseWindow, the webcontents will always grab the focus from whichever has it currently. It would be very useful to have an option to add the child view without losing focus from the current web contents.
Example: I have a child view with an input box which, as you type, creates another child view showing related contents. After the child view is created and addChildView called, the focus switches to the new child view and you can't continue typing into the original input box.
Proposed Solution
Change addChildView from addChildView(view, [index]) to addChildView(view, [options]) where
options = {
index?:number, // Default is the end of the list
focus?:boolean // Default is true
}
For backwards compatibility, check if options is a number and behave as it does currently.
Alternatives Considered
I've tried a number of alternatives, such as setting the parent BaseWindow with setFocusable(false) before adding the child view but this move other windows above the current and also loses focus.
Additional Information
No response
The text was updated successfully, but these errors were encountered:
GramboStorm
changed the title
[Feature Request]: addChildView option to stop it added view grabbing focus
[Feature Request]: addChildView option to stop the added view grabbing focus
Jun 2, 2024
Preflight Checklist
Problem Description
Whenever addChildView is called to add a WebContentsView to an existing BaseWindow, the webcontents will always grab the focus from whichever has it currently. It would be very useful to have an option to add the child view without losing focus from the current web contents.
Example: I have a child view with an input box which, as you type, creates another child view showing related contents. After the child view is created and addChildView called, the focus switches to the new child view and you can't continue typing into the original input box.
Proposed Solution
Change addChildView from addChildView(view, [index]) to addChildView(view, [options]) where
For backwards compatibility, check if options is a number and behave as it does currently.
Alternatives Considered
I've tried a number of alternatives, such as setting the parent BaseWindow with setFocusable(false) before adding the child view but this move other windows above the current and also loses focus.
Additional Information
No response
The text was updated successfully, but these errors were encountered: