BrowserWindow not respecting minWidth on windows


#1

Anyone experiencing the same issue? On linux/mac the code below works perfectly, but on windows the browser window is ~14px under the specified minWidth which adds a horizontal scrollbar when it should not be there.

Just using this code you can see the issue.

Here is the Main.js

    const { app, browserWindow } = require('electron');

    let mainWindow;

    app.on('window-all-closed', () => { app.quit(); });

    app.on('ready', () => {

        mainWin = new BrowserWindow({
            width: 400,
            height: 600,
            minWidth: 300,
            minHeight: 400
        });
        mainWin.loadURL('file://`' + __dirname + './index.html');
    });

Here is the index.html

<!DOCTYPE html>
<html>
    <head>
    <style>
       html, body { height: 100%; margin: 0; }
       body {
         display: flex;
         flex-flow: column;
         background: #ddd;
       }
       
       webview { flex: 1; }
    </style>
    <script src="./renderer-process/profile-renderer.js"></script>
    <body>
      <webview src="about:blank" preload="./renderer-process/profile-preload.js"></webview>
    </body>

</html>

#2

So I can’t edit my post but the index.html should actually be

html, body { height: 100%; margin: 0; } body { display: flex; flex-flow: column; background: #ddd; }
   webview { flex: 1; }
</style>
<body>
  <webview src="www.github.com"></webview>
</body>