-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Respect forms with enctype set for view transitions #9466
Respect forms with enctype set for view transitions #9466
Conversation
🦋 Changeset detectedLatest commit: b3be36f The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @knpwrs, thanks for your quick PR!
While it solves the original problem and maintains compatibility for the encoding behavior, it still leads to incompatibilities in the client-side router and transition events.
Could you please try to base your solution on the existing sourceElement
property? I have left details in the comments in the code. That way you could access the form directly or via the event's handler from the defaultLoader()
. If this works, no changes to the navigate()
options or the events would be required.
This reverts commit 6d3e04a.
@martrapp thank you for the feedback, I think these changes should address what you've said. |
Great! Much more concise! Were you able to test it? Does it sill work? |
The latest commit is tested and working with both forms and submitters. |
So far everything looks good and it was very pleasant and productive how you solved the problem! I'm very happy with where we are now. As you wrote, we can simply fall back to the standard of form.enctype for 5.0. I like to quote a dear colleague: definitely much "better than what we had before". I don't want to overshoot the mark, but we need additional e2e tests now. Since we don't have a long history together yet, I'll ask very carefully: do you want to add them or are you satisfied with what we've achieved so far ;-) |
I'm open to giving it a go tonight. It'll be a good opportunity to try out playwright test and I can see there's some prior-art for view transitions that I can model after. |
😃 Thanks a lot! As you may have seen, all e2e tests for view transitions are located in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me! Would be great to have tests, as @martrapp suggested!
Tests have been pushed! |
Very good solution! Thank you again, it was a pleasure! |
Changes
This makes progressively-enhanced forms (via
ViewTransitions
) respect theenctype
attribute.Closes #9447.
Testing
I built the repo and added a form to the view transitions example and tried submitting the form with both
enctype
set and not set.Docs
I will submit a PR to update the docs.