Conversation
🦋 Changeset detectedLatest commit: e6d283a 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 |
|
The code already existed in the click handler, but could not be directly reused for form submission as the submit event is no mouse event and does not know about keys. But if the form get's submitted by clicking, we remember the last "clicked with keys" element and compare it to the submit's submitter element. |
There was a problem hiding this comment.
Pull Request Overview
This pull request improves the ClientRouter behavior, allowing form submissions to trigger native browser handling (e.g., open new tabs or windows) when users hold modifier keys during a click.
- Delegates form submissions to the browser when modifier keys (Cmd, Ctrl, or Shift) are detected
- Documents the change via an updated changeset file
Files not reviewed (1)
- packages/astro/components/ClientRouter.astro: Language not supported
…o#13750) * ClientRouter: honor ctrl/shift... keys when clicking submit * clean up after use
Changes
When submitting a form, the client router now delegates back to the browser when the user holds hift alt or cmd/ctrl keys while clicking submit. This allows the browser to open a new tab / window or download. These are all cases where you won't get view transitions anyhow.
Closes #13744
Testing
tested manually
Docs
n.a., bug fix