-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: allow native form submission for <form target="_blank">
and <button formtarget="_blank">
#11936
Conversation
🦋 Changeset detectedLatest commit: d79d201 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
target="_blank"
<form target="_blank">
and <button formtarget="_blank">
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.
On line 2098 we could change it to use that target
variable, I can't make a suggestion on github ui unfortunately
Are you referring to |
I was talking about this line: kit/packages/kit/src/runtime/client/client.js Line 2098 in d79d201
|
I’m not sure if that’s right. We need the action property to determine the URL the form is sending the request to while the target property species with frame to open the response in |
fixes #11931
This PR ensures that our client submit event listener allows the browser to make a native form submission to open a new tab if a form or button has the
target="_blank"
orformtarget="_blank"
attribute. This should open the form response in a new tab for both GET and POST submissions.Afaik the other
target
values such as_parent
and_top
should function similarly to_self
where we just want to update the current page without refreshing (even if Kit is in an iframe).Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits