Skip to content
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

[Bug]: WebContentsView has no ability to set which view is "on top" when overlapping #42061

Closed
3 tasks done
neobyteUK opened this issue May 7, 2024 · 2 comments · Fixed by #42085
Closed
3 tasks done
Labels

Comments

@neobyteUK
Copy link

Preflight Checklist

Electron Version

30.0.2

What operating system are you using?

Windows

Operating System Version

Windows 10

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

When two BrowserViews within a single BrowserWindow overlap, the one that is "on top" is interactable with. Which one is on top can be set via:

window.setTopBrowserView(view);

I would expect there to be a similar API for WebContentsView.

Actual Behavior

There is no API for WebContentsView.

Testcase Gist URL

No response

Additional Information

This can be worked around via removing and immediately re-adding a WebContentsView, which appears to set it to the "top".

window.contentView.removeChildView(view);
window.contentView.addChildView(view);

But this feels like a regression versus what we had before.

@neobyteUK
Copy link
Author

neobyteUK commented May 8, 2024

Looks like this will be effectively resolved when #42085 is merged.

@mckravchyk
Copy link
Contributor

I think there should be a direct method to do it, like setTopChildView. The intent of calling addChildView on existing view to push it on top is not clear and requires either adding a comment to explain it or creating a wrapper function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants