client icon indicating copy to clipboard operation
client copied to clipboard

Resizing the window makes hidden webviews have incorrect sizing

Open deanpress opened this issue 6 years ago • 6 comments

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)

  1. Open a new tab
  2. Maximize the nOS Client window
  3. Navigate to previous tab

Your Environment

  • Version used: development branch
  • Operating System and version (desktop or mobile): Linux Mint 18

deanpress avatar Jun 09 '18 20:06 deanpress

  • 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

mhuggins avatar Jun 09 '18 21:06 mhuggins

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).

trueinsider avatar Jun 23 '18 23:06 trueinsider

This might be an approach to consider for manually resizing: https://github.com/electron/electron/pull/7658#issuecomment-254397903

mhuggins avatar Aug 03 '18 20:08 mhuggins

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

mhuggins avatar Aug 03 '18 20:08 mhuggins

https://github.com/electron/electron/pull/7658#issuecomment-254397903 I tried this approach, problem with it described above.

trueinsider avatar Aug 03 '18 21:08 trueinsider

Issue within webviews, referring to the issue: https://github.com/electron/electron/issues/5110

DalderupMaurice avatar Mar 12 '19 18:03 DalderupMaurice