fix: remove indeterminate from boolean attributes (#8334)

It's only existing as a boolean property
cleanup of #7944
pull/8335/head
Simon H 2 years ago committed by GitHub
parent 3423bf6b30
commit 636290af95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,3 @@
// source: https://html.spec.whatwg.org/multipage/indices.html
const _boolean_attributes = [ const _boolean_attributes = [
'allowfullscreen', 'allowfullscreen',
'allowpaymentrequest', 'allowpaymentrequest',
@ -12,7 +11,6 @@ const _boolean_attributes = [
'disabled', 'disabled',
'formnovalidate', 'formnovalidate',
'hidden', 'hidden',
'indeterminate',
'inert', 'inert',
'ismap', 'ismap',
'itemscope', 'itemscope',
@ -30,4 +28,9 @@ const _boolean_attributes = [
] as const; ] as const;
export type BooleanAttributes = typeof _boolean_attributes[number]; export type BooleanAttributes = typeof _boolean_attributes[number];
/**
* List of HTML boolean attributes (e.g. `<input disabled>`).
* Source: https://html.spec.whatwg.org/multipage/indices.html
*/
export const boolean_attributes: Set<string> = new Set([..._boolean_attributes]); export const boolean_attributes: Set<string> = new Set([..._boolean_attributes]);

@ -1,14 +1,14 @@
export default { 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: { props: {
indeterminate: true indeterminate: true
}, },
html: "<input type='checkbox'>", html: "<input type='checkbox'>",
// somehow ssr will render indeterminate=""
// the hydrated html will still contain that attribute
ssrHtml: "<input type='checkbox' indeterminate=''>",
test({ assert, component, target }) { test({ assert, component, target }) {
const input = target.querySelector('input'); const input = target.querySelector('input');

Loading…
Cancel
Save