fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
24.93k stars 1.38k forks source link

dialog.New(Folder, File, etc)Open(callback, parent) + Show() does not work in javascript / wasm #5211

Open brucealthompson opened 2 days ago

brucealthompson commented 2 days ago

Checklist

Describe the bug

I have created a new fyne repository interface that implements a subset of webdav functionality. This repository should work with js / wasm since it does not rely on local filesystem calls.

This repository is working with dialog.NewFolderOpen(callback, parent) + Show() when built for Windows. Using a verrsion of fyne with the fix for https://github.com/fyne-io/fyne/issues/5200 included. This dialog.NewFolderOpen(callback, parent) + Show() does NOT work with this repository when built for js / wasm.

Instead of Show() displaying a File/Foler open dialog box, nothing happens.

I assume this issue is due to the other ties that fyne.io\fyne\v2@v2.5.2\dialog\file.go has with the fyne "file" repository. See the following issues for examples of the above: https://github.com/fyne-io/fyne/issues/5207 https://github.com/fyne-io/fyne/issues/5204

How to reproduce

  1. Create a non "file" fyne repository that does not rely on local filesystem calls.
  2. Use the example code below to create a Folder Open dialog using that repository.
  3. Build the application for js / wasm with "fyne package -os web"

Screenshots

No response

Example code

locationURI, err := storage.ParseURI("httpfile:///") if err != nil { return err } listableURI, err := storage.ListerForURI(locationURI) if err != nil { return err } folderdialog := dialog.NewFolderOpen(callback, parent) folderdialog.SetLocation(listableURI) folderdialog.Show()

Fyne version

2.5.2

Go compiler version

1.23.1

Operating system and version

Windows 11

Additional Information

No response

dweymouth commented 2 days ago

I think this is a duplicate of #2737

andydotxyz commented 2 days ago

I think they are related but not identical. This is requesting a file open dialog with a source that is not the local filesystem. Any UI that uses a native dialog might actually need to bring up our own picker instead of native when we know the URI is not local filesystem. So this is pretty much the other half of that for web - we can support this without solving the local FS read through javascript.

I looked into it and could not figure why the dialog would not be appearing, might require a little debugging to get to the bottom of it and understand the challenge.

brucealthompson commented 1 day ago

Agree. I have not yet set up a javascript / wasm debugging environment in VS Code yet. Looks like it is really cumbersome to set up.

            Bruce T

From: Andy Williams @.> Sent: Friday, October 18, 2024 1:01 PM To: fyne-io/fyne @.> Cc: Bruce Thompson @.>; Author @.> Subject: Re: [fyne-io/fyne] dialog.New(Folder, File, etc)Open(callback, parent) + Show() does not work in javascript / wasm (Issue #5211)

I think they are related but not identical. This is requesting a file open dialog with a source that is not the local filesystem. Any UI that uses a native dialog might actually need to bring up our own picker instead of native when we know the URI is not local filesystem. So this is pretty much the other half of that for web - we can support this without solving the local FS read through javascript.

I looked into it and could not figure why the dialog would not be appearing, might require a little debugging to get to the bottom of it and understand the challenge.

— Reply to this email directly, https://github.com/fyne-io/fyne/issues/5211#issuecomment-2423066533 view it on GitHub, or https://github.com/notifications/unsubscribe-auth/AIPC5HYG5ZNILGDXWRPAMULZ4FLE7AVCNFSM6AAAAABQFUXT6WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRTGA3DMNJTGM unsubscribe. You are receiving this because you authored the thread. https://github.com/notifications/beacon/AIPC5H2W7PYE77XWEUS5DUDZ4FLE7A5CNFSM6AAAAABQFUXT6WWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUQNUH2K.gif Message ID: < @.> @.>