-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevents inputs from changing ViewTransitions' form method or action (#…
…10856) * Prevents inputs from changing ViewTransitions' form method or action. Fixes #10849 * Consistency 🧘♂️
- Loading branch information
1 parent
d7dff64
commit 30cf82a
Showing
5 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"astro": patch | ||
--- | ||
|
||
Prevents inputs with a name attribute of action or method to break ViewTransitions' form submission |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/astro/e2e/fixtures/view-transitions/src/pages/form-seven.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
import Layout from '../components/Layout.astro'; | ||
--- | ||
<Layout> | ||
<form> | ||
<p>This form has an no method defined, but input with `name=method`</p> | ||
<input type="text" name="method" value="POST" /> | ||
<button id="submit">Submit</button> | ||
</form> | ||
</Layout> |
11 changes: 11 additions & 0 deletions
11
packages/astro/e2e/fixtures/view-transitions/src/pages/form-six.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
import Layout from '../components/Layout.astro'; | ||
--- | ||
<Layout> | ||
<form method="POST" action="bar"> | ||
<p>This form has an input with `name=action`</p> | ||
<input type="text" name="action" value="foo" /> | ||
<button id="submit">Submit</button> | ||
</form> | ||
</Layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters