fix: loosen input in button error (#10083)

The validation exists to error on html that would result in the browser repairing it, causing hydration errors. input is never moved, so we can remove it from the array

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
pull/10070/head
Dominic Gannaway 9 months ago committed by GitHub
parent 94aab90bd1
commit 86eae7e77d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: allow input elements within button elements

@ -121,15 +121,8 @@ function validate_code(code) {
// based on http://developers.whatwg.org/syntax.html#syntax-tag-omission
const interactive_elements = new Set([
'a',
'button',
'iframe',
'embed',
'input',
'select',
'textarea'
]);
// while `input` is also an interactive element, it is never moved by the browser, so we don't need to check for it
const interactive_elements = new Set(['a', 'button', 'iframe', 'embed', 'select', 'textarea']);
/** @type {Record<string, Set<string>>} */
const disallowed_contents = {

Loading…
Cancel
Save