From 636290af954a2b37a263b35c6deb69f149b59905 Mon Sep 17 00:00:00 2001
From: Simon H <5968653+dummdidumm@users.noreply.github.com>
Date: Mon, 27 Feb 2023 11:33:45 +0100
Subject: [PATCH] fix: remove indeterminate from boolean attributes (#8334)
It's only existing as a boolean property
cleanup of #7944
---
src/shared/boolean_attributes.ts | 7 +++++--
.../samples/attribute-boolean-indeterminate/_config.js | 8 ++++----
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/shared/boolean_attributes.ts b/src/shared/boolean_attributes.ts
index f6ec25c6e5..668dd97975 100644
--- a/src/shared/boolean_attributes.ts
+++ b/src/shared/boolean_attributes.ts
@@ -1,4 +1,3 @@
-// source: https://html.spec.whatwg.org/multipage/indices.html
const _boolean_attributes = [
'allowfullscreen',
'allowpaymentrequest',
@@ -12,7 +11,6 @@ const _boolean_attributes = [
'disabled',
'formnovalidate',
'hidden',
- 'indeterminate',
'inert',
'ismap',
'itemscope',
@@ -30,4 +28,9 @@ const _boolean_attributes = [
] as const;
export type BooleanAttributes = typeof _boolean_attributes[number];
+
+/**
+ * List of HTML boolean attributes (e.g. ``).
+ * Source: https://html.spec.whatwg.org/multipage/indices.html
+ */
export const boolean_attributes: Set = new Set([..._boolean_attributes]);
diff --git a/test/runtime/samples/attribute-boolean-indeterminate/_config.js b/test/runtime/samples/attribute-boolean-indeterminate/_config.js
index aafb0ec164..5853e76922 100644
--- a/test/runtime/samples/attribute-boolean-indeterminate/_config.js
+++ b/test/runtime/samples/attribute-boolean-indeterminate/_config.js
@@ -1,14 +1,14 @@
export default {
+ // This is a bit of a funny one — there's no equivalent attribute,
+ // so it can't be server-rendered
+ skip_if_ssr: true,
+
props: {
indeterminate: true
},
html: "",
- // somehow ssr will render indeterminate=""
- // the hydrated html will still contain that attribute
- ssrHtml: "",
-
test({ assert, component, target }) {
const input = target.querySelector('input');