Skip to content

Commit

Permalink
fix: correctly handle novalidate attribute casing (#15083)
Browse files Browse the repository at this point in the history
This PR fixes #15082 by correctly handling the HTML element novalidate attribute casing through noValidate DOM property mapping.
  • Loading branch information
Rican7 authored Jan 22, 2025
1 parent 7da86ef commit eee808f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/pink-wolves-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: correctly handle `novalidate` attribute casing
3 changes: 2 additions & 1 deletion packages/svelte/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ const ATTRIBUTE_ALIASES = {
readonly: 'readOnly',
defaultvalue: 'defaultValue',
defaultchecked: 'defaultChecked',
srcobject: 'srcObject'
srcobject: 'srcObject',
novalidate: 'noValidate'
};

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { test } from '../../test';

export default test({
html: `
<form novalidate></form>
<form novalidate></form>
`
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script>
let noValidate = $state(true);
</script>

<form novalidate={true}></form>
<form {noValidate}></form>

0 comments on commit eee808f

Please sign in to comment.