electron / electron

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS
https://electronjs.org
MIT License
114.57k stars 15.51k forks source link

[Bug]: showOpenDialog with openDirectory *STILL* can not choose folder #44909

Open devzzzero opened 5 hours ago

devzzzero commented 5 hours ago

Preflight Checklist

Electron Version

electron@33.2.1 | MIT | deps: 3 | versions: 1353

What operating system(s) are you using?

Other Linux

Operating System Version

openSuse 15.5 LTS

What arch are you using?

x64

Last Known Working Electron version

???

Expected Behavior

[Bug]: showOpenDialog with openDirectory can not choose folder #30125

Hi. This bug is a lot like #30125 except on linux with a recent electron (33.?)

So here is my code snippet from my main.ts file

    'openDir' : ipcMain.handle('openDir', async (ev, { title, defaultPath } )=>{
      console.log(`MAIN.openDir ${title} ${defaultPath}`);
      const thePath =  await dialog.showOpenDialog({
        title,
        properties:['openDirectory'],
      });
      console.log(`MAIN.openDir ${title} ${defaultPath} ${thePath}`);
      return thePath;
    }),
    'openFile' : ipcMain.handle('openFile', async (ev, { title, defaultPath } )=>{
      console.log(`MAIN.openFile ${title} ${defaultPath}`);
      const thePath = await dialog.showOpenDialog({
        title, defaultPath,
        properties:['openFile', 'showHiddenFiles'],
      });
      console.log(`MAIN.openFile ${title} ${defaultPath} got ${JSON.stringify(thePath)}`);
      return thePath;
    }),

Actual Behavior

openFile IPC/showopendialog works.

However, when I use openDir IPC, the KDialog (linux) can not be closed when I am navigating to a directory. Even worse, even though the 'openDirectory' properties are clearly set, it can only be 'non-cancel' closed unless I select a file! I don't think this is a KDE Dialog issue. Furthermore, I purposefully mistyped "openDirectory", but nary a peep from electron.

Testcase Gist URL

No response

Additional Information

No response

electron-issue-triage[bot] commented 5 hours ago

Hello @devzzzero. Thanks for reporting this and helping to make Electron better!

The version of Electron reported in this issue has reached end-of-life and is no longer supported. If you're still experiencing this issue on a supported version of Electron, please update this issue to reflect that version of Electron.

Now adding the https://github.com/electron/electron/labels/blocked%2Fneed-info%20%E2%9D%8C label for this reason. This issue will be closed in 10 days if the above is not addressed.