Fix toggle_attribute disabled check for checkbox inputs

Use the computed `value` and `dataValue` variables instead of raw
`event.target.value` and `this.dataset.value` when setting the
disabled state on hidden inputs. For checkboxes, event.target.value
returns the HTML value attribute (e.g. "true") rather than the
checked state, causing the disabled toggle to always evaluate
incorrectly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pull/601/head
Don Kendall 3 weeks ago
parent 13fa87c449
commit 523bbff172

@ -14,7 +14,7 @@ export default class extends HTMLElement {
this.target.classList.toggle(this.dataset.className, value !== dataValue)
if (this.dataset.className === 'hidden' && this.target.tagName === 'INPUT') {
this.target.disabled = event.target.value !== this.dataset.value
this.target.disabled = value !== dataValue
}
}

Loading…
Cancel
Save