14 Commits

Author SHA1 Message Date
Simon Hartley
e2353e26bc
Allow use of "this" when evaluating hx-vals (#3332)
Evaluate hx-vals with "this" referring to the element it is defined on

Co-authored-by: scrhartley <scrhartley@github.com>
2025-06-20 14:52:17 -06:00
Simon Hartley
db8e5e03cb
Fix event not being available in hx-vals/hx-vars when hx-trigger has delay (#3196)
Fix event not being available in hx-vals/hx-vars when hx-trigger uses delay

Co-authored-by: scrhartley <scrhartley@github.com>
2025-04-24 13:58:31 -06:00
MichaelWest22
24a0106f76
Update testing framework to web-test-runner and improve code coverage (#3273)
* Fix old npm dependencies

* implement web-test-runner tests for headless alongside Mocha browser tests

* Increase test and code coverage

* update to 100% coverage and impove eslint

* Update testing Doco

* revert all htmx changes and updates/disable tests needed

* fix browser mocha test

* Default testing to use playwrite only instead of puppeter

* playwright install fix

* Imporve test summary reporting

* flatten false looks closer to original
2025-04-17 17:55:43 -06:00
Carson Gross
1537833ae0 Merge remote-tracking branch 'origin/dev' into dev 2024-10-02 19:58:30 -06:00
Eric Kwoka
b23b2f034e
🐛 Prevents erroring on null vals (#2799)
* 🐛 Prevents erroring on null vals

* 🚧 Applies same fix in FormProxy

* 🧪 Adds Test for null in FormDataProxy
2024-10-02 19:21:02 -06:00
shouya
e6a2ea15a2
Documentation for dynamic hx-vals (#2898)
* add test for spread operator in hx-vals

* update documentation

Closes #2885
2024-09-13 10:19:21 +02:00
Alexander Petros
4b890ce72d Run linter on the tests too 2023-12-21 13:22:10 -05:00
Mark Gibson
94623d1129
Fix hx-on/hx-on:* to suppress evaluation if allowEval is false (#1682)
* Added more tests for allowEval=false

* Wrap hx-on event handlers in maybeEval

* Create and cache hx-on function on first event trigger.
2023-08-24 12:11:00 -06:00
Ben Lenton
c3662ce00d
Allow 'unset' directive for hx-vals and hx-vars (#1013)
* Allow 'unset' directive for hx-vals and hx-vars

* PR feedback

Co-authored-by: Ben Lenton <benlenton@Bens-MacBook-Air.local>
2022-09-30 14:08:46 -06:00
carson
cd6d2b78e2 convert objects to JSON representation
fixes https://github.com/bigskysoftware/htmx/issues/772
2022-01-18 20:21:26 -07:00
carson
3c3cd304ae add test for hx-headers 2021-02-05 11:00:03 -07:00
carson
6ed5c7e1b8 temp work 2021-02-01 10:21:54 -07:00
carson
d464b91d1e Add braces test 2020-11-15 17:56:23 -07:00
carson
5acd554a5c Two-fer:
* Implement `hx-vals` which is a JSON-only (and therefore safer) version of `hx-vars`
* Port all internal evals to use `Function` instead

May fix https://github.com/bigskysoftware/htmx/issues/213
2020-11-15 17:54:54 -07:00