Skip to content

Commit 636290a

Browse files
authored
fix: remove indeterminate from boolean attributes (#8334)
It's only existing as a boolean property cleanup of #7944
1 parent 3423bf6 commit 636290a

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/shared/boolean_attributes.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// source: https://html.spec.whatwg.org/multipage/indices.html
21
const _boolean_attributes = [
32
'allowfullscreen',
43
'allowpaymentrequest',
@@ -12,7 +11,6 @@ const _boolean_attributes = [
1211
'disabled',
1312
'formnovalidate',
1413
'hidden',
15-
'indeterminate',
1614
'inert',
1715
'ismap',
1816
'itemscope',
@@ -30,4 +28,9 @@ const _boolean_attributes = [
3028
] as const;
3129

3230
export type BooleanAttributes = typeof _boolean_attributes[number];
31+
32+
/**
33+
* List of HTML boolean attributes (e.g. `<input disabled>`).
34+
* Source: https://html.spec.whatwg.org/multipage/indices.html
35+
*/
3336
export const boolean_attributes: Set<string> = new Set([..._boolean_attributes]);

test/runtime/samples/attribute-boolean-indeterminate/_config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
export default {
2+
// This is a bit of a funny one — there's no equivalent attribute,
3+
// so it can't be server-rendered
4+
skip_if_ssr: true,
5+
26
props: {
37
indeterminate: true
48
},
59

610
html: "<input type='checkbox'>",
711

8-
// somehow ssr will render indeterminate=""
9-
// the hydrated html will still contain that attribute
10-
ssrHtml: "<input type='checkbox' indeterminate=''>",
11-
1212
test({ assert, component, target }) {
1313
const input = target.querySelector('input');
1414

0 commit comments

Comments
 (0)