htmx
htmx copied to clipboard
Fix checkbox trigger specifier when used with checkboxes
Description
Unlike other form elements, checkbox elements will return on whether or not they are currently ticked. Explicitly handle this by checking for the tag name and type and then use the checked property.
Testing
A new test case is included, failing before.
Checklist
- [X] I have read the contribution guidelines
- [X] I have targeted this PR against the correct branch (
masterfor website changes,devfor source changes) - [X] This is either a bugfix, a documentation update, or a new feature that has been explicitly approved via an issue
- [X] I ran the test suite locally (
npm run test) and verified that it succeeded
Note: this PR is on top of #2893
Note: I'm labelling this as "under discussion" until #2891 is processed, as the latter includes some changes that this PR depends on. If and when #2891 is merged in, this PR's diff will be smaller thus easier to review.
Rebased on current dev, should be easy to merge now.