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

Allow BrowserView below BrowserWindow #16854

Closed
IceHacks opened this Issue Feb 9, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@IceHacks
Copy link

IceHacks commented Feb 9, 2019

Is your feature request related to a problem? Please describe.
Yeah. When I create a BrowserView it is placed above my BrowserWindow. Therefore I can not see my dropdown menus.

Describe the solution you'd like
I'd like to be able to set the z-index of a BrowserView or have an option to display below the BrowserWindow. My BrowserWindow is transparent and I set it up so you can click through it.

Describe alternatives you've considered
WebView's are my choice if I can't get this to work because they are nested in the page.

Additional context
Here is my menu being cut-off:
image

@welcome

This comment has been minimized.

Copy link

welcome bot commented Feb 9, 2019

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@IceHacks IceHacks changed the title Allow BrowserView belo BrowserWindow Allow BrowserView below BrowserWindow Feb 9, 2019

@MarshallOfSound

This comment has been minimized.

Copy link
Member

MarshallOfSound commented Feb 11, 2019

This is not currently possible with the architecture of BrowserView

@Kant1-0

This comment has been minimized.

Copy link

Kant1-0 commented Feb 13, 2019

@IceHacks If you have a dropdown menu from your BrowserWindow that will overflow on BrowserView, the only way to display it is using context menu.

const menu = Menu.buildFromTemplate(submenu);

parent.querySelector(children).onclick = (e) => {
  menu.popup({
    window: getCurrentWindow(),
    x: e.target.offsetLeft,
    y: e.target.offsetTop + e.target.offsetHeight,
  });
};

Unfortunately these context menus can't be customized with CSS. I guess you'll be able later to convert this dropdown menu into another BrowserView when a futur update will able us to use multiple browserView with z-ordering.

Some recent commit here added support for multiple browser views: https://github.com/electron/electron/blob/27bd47a3336ea176bb3f092fc428d7f1758e782f/docs/api/browser-window.md#winaddbrowserviewbrowserview-experimental

## win.addBrowserView(browserView) Experimental

- browserView BrowserView

Replacement API for setBrowserView supporting work with multi browser views.
@IceHacks

This comment has been minimized.

Copy link
Author

IceHacks commented Feb 15, 2019

Ok thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment