client
client copied to clipboard
Resizing the window makes hidden webviews have incorrect sizing
Expected Behavior
Navigating to a different tab after resizing the nOS Client window should show the webview with correct sizing.
Current Behavior
Previous tabs will cause the webviews to have incorrect sizing.
Steps to Reproduce (for bugs)
- Open a new tab
- Maximize the nOS Client window
- Navigate to previous tab
Your Environment
- Version used: development branch
- Operating System and version (desktop or mobile): Linux Mint 18
- Related issue reported to electron: https://github.com/electron/electron/issues/8277
- Possible workaround to use
contents.setSize(...)
: https://github.com/electron/electron/pull/7658
I was thinking how to solve that but encountered a problem.
In the workaround they set WebContents' size to window size, however in our case WebContents' size is smaller (-70px width and -104px height) because of navigation and address panels. I didn't want to hardcode these values. But I couldn't access WebContents' current size (that way I could've added delta to it). I also tried to resize from inside DAppContainer
but I couldn't access all other WebContents from there (only current).
This might be an approach to consider for manually resizing: https://github.com/electron/electron/pull/7658#issuecomment-254397903
Another workaround, which we can do when tabs are hidden. One consideration for this approach is that scroll position could be lost: https://github.com/electron/electron/issues/5110#issuecomment-208991872
https://github.com/electron/electron/pull/7658#issuecomment-254397903 I tried this approach, problem with it described above.
Issue within webviews, referring to the issue: https://github.com/electron/electron/issues/5110