flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
10.85k stars 417 forks source link

FilePicker not opening dialog on web for iOS #3710

Open victorbdn83 opened 1 month ago

victorbdn83 commented 1 month ago

Duplicate Check

Describe the bug

FilePicker is not opening the dialog to select a file when it's a web app and accessing it from iOS. I'm testing this form an app I'm making and it works fine when I access the web app from an Android device or laptop, but not from an iPhone. I thought it might be something with my code, but then I checked your controls gallery and I have the same issue, dialog is not opening if I try it from an iPhone (https://flet-controls-gallery.fly.dev/utility/filepicker)

I tried this with different browsers on the same iPhone (Safari, Chrome, Firefox and Qwant) and with a different iPhone, but I got the same issue.

I also tried setting the desktop mode on the browser, but same result.

Code sample

https://flet-controls-gallery.fly.dev/utility/filepicker

To reproduce

  1. Access the website https://flet-controls-gallery.fly.dev/utility/filepicker from an iPhone
  2. Try to pick a file

Expected behavior

Dialog to select a file for uploading should open

Screenshots / Videos

Screenshots / Video demonstration [Upload media here]

https://github.com/user-attachments/assets/9d58b299-1fb4-472d-a78c-ff9c244c439a

Operating System

macOS

Operating system details

iOS 17.5.1

Flet version

0.23.2

Regression

No, it isn't

Suggestions

No response

Logs

Logs ```console [Paste your logs here] ```

Additional details

No response

TakahiroAoyagi commented 1 month ago

I'm having the exact same problem. When accessing a web page from iOS, the file selection dialog does not appear and the on_result event is not fired.

TakahiroAoyagi commented 1 month ago

I tested by downgrading the version of flet to check for differences in behavior regarding this issue. As a result, I found that versions up to v0.1.63 exhibit a strange behavior where the dialog is displayed only once. In versions v0.1.64 and later, the dialog does not appear.

The video was taken with v0.1.63. The environment is iPad OS 17.5.1.

I realize this information may not be very useful, but I hope it can be of some help. I hope this issue gets resolved soon.

https://github.com/user-attachments/assets/b28eb4a9-b385-41ba-b013-df32bb137e44

TakahiroAoyagi commented 1 month ago

As a beginner, I'm not able to make very valuable posts, but I have found a strange behavior. When calling pick_files in an on_click event for widgets like ElevatedButton, nothing happens. However, when calling pick_files in an on_change event for widgets like Checkbox, the dialog appears as expected.