Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When taking a photo, the underlying view (aka form) is reset #218

Open
olliekav opened this issue Jun 26, 2024 · 1 comment
Open

When taking a photo, the underlying view (aka form) is reset #218

olliekav opened this issue Jun 26, 2024 · 1 comment

Comments

@olliekav
Copy link

I saw there was another issue for this, but I can't resolve this by using another branch.

To reproduce:

  • Click on field field
  • Choose 'Take photo'
  • Form / view is reloaded when photo view is closed, photo never gets attached

Is there any insight how I can fix this or what is suddenly causing it?

@edooley
Copy link

edooley commented Jul 30, 2024

Experiencing the same issue. It's because of this line.

Turbo is understandably trying to handle the situation where a native view is dismissed and is returning to the webview. In this case, that's the camera, but it's in the middle of trying to apply the newly taken photo to the file upload input, so the form data gets wiped out.

In the meantime, I can confirm that adding the data-turbo-permanent attribute to the input (or one of its parents) will maintain the file selection. Perhaps that is the appropriate solution to this use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants