Skip to content

Commit eee808f

Browse files
authored
fix: correctly handle novalidate attribute casing (#15083)
This PR fixes #15082 by correctly handling the HTML element novalidate attribute casing through noValidate DOM property mapping.
1 parent 7da86ef commit eee808f

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

.changeset/pink-wolves-search.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: correctly handle `novalidate` attribute casing

packages/svelte/src/utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ const ATTRIBUTE_ALIASES = {
196196
readonly: 'readOnly',
197197
defaultvalue: 'defaultValue',
198198
defaultchecked: 'defaultChecked',
199-
srcobject: 'srcObject'
199+
srcobject: 'srcObject',
200+
novalidate: 'noValidate'
200201
};
201202

202203
/**
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { test } from '../../test';
2+
3+
export default test({
4+
html: `
5+
<form novalidate></form>
6+
<form novalidate></form>
7+
`
8+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<script>
2+
let noValidate = $state(true);
3+
</script>
4+
5+
<form novalidate={true}></form>
6+
<form {noValidate}></form>

0 commit comments

Comments
 (0)