668 Commits

Author SHA1 Message Date
MichaelWest22
5b550e5c49
Optimize Head regex (#2781)
* remove shared tag regex utility function that is no longer really needed

* fix head-support manual test to point to externally hosted extension

* minimize regex
2024-10-02 19:20:23 -06:00
MichaelWest22
b98e4f2b12
fix htmx.ajax defaulting to swap body when target not found (#2878)
* ajax helper handle no target

* allow source only targeting

* Add tests

* Handle source set but invalid target set

* Improve source logic

* missed #

* improve readiblity and add inline comment
2024-10-02 19:18:22 -06:00
Joerg Sonnenberger
df92b295d6
Change hx-trigger's changed modifier to work for independent trigger specifications (#2891)
* Adjust hx-trigger's changed modifier for multiple sources

The `changed` trigger modifier can see different event targets, either due
to the `from` modifier or event bubbling. The existing behavior trigger
only for one node (`from` modifier) or inconsistently (bubbling).

Use a nested weak map to keep track of the last value per distinguished
(trigger specification, event target node) pair. The weak map ensures
that Garbage Collection can still recycle the nodes.

If a event target was not seen via `from`, it is assumed changed for the
first time the trigger is hit.

* Add test case for separate triggers with changed modifier
2024-10-02 19:17:25 -06:00
Jackie Li
4916ce4d02
fix #2932: check parent is null for swap delete (#2933)
* fix #2932: check parent is null for swap

* fix test in swap when parent elt deleted
2024-10-02 19:08:39 -06:00
MichaelWest22
4a8172325e
enable hx-preserve handing for oob swaps (#2934)
* Add support for oob swaps with hx-preserve

* Add tests

* Documentation

* Impove fix to handle when oob swaps shouldSwap set false
2024-10-02 19:02:46 -06:00
MichaelWest22
d528c9d94d
Handle Space before comma in Trigger Spec (#2903)
* strip space after trigger spec

* Add test

* handle addiional case
2024-09-25 13:12:37 -06:00
MichaelWest22
3d1a2e5202
[bug] load trigger stops hx-disabled-elt getting re-enabled (#2925)
* allow disable-elt on load to function

* Update requestCount fallback
2024-09-25 12:13:25 -06:00
Carson Gross
b8c92b8071 Merge branch 'master' into dev 2024-09-25 12:07:51 -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
Vincent
326ff3b296
Fix focusin-based tests (#2861) 2024-09-01 14:22:04 -04:00
Carson Gross
2855c2c24e merge https://github.com/bigskysoftware/htmx/pull/2723 2024-08-29 12:00:00 -06:00
Ben Croker
cd6cdb275e
Ability to add options argument to event listener (#2836)
* Update htmx.js

* Update events.js

* Add fallback value

* Use JSDoc syntax

* Document parameter

* Only accept an object

* Revert change

* Add useCapture

* Update htmx.js

* Add `useCapture` test

* Clean up

* Revert addition of test
2024-08-29 10:36:24 -06:00
Carson Gross
b4048ebb59 add moveBefore support 2024-08-23 15:20:01 -06:00
ehenighan
27fc37ce50
Issue #2676 - Tests for v2 to prevent regression of issue from v1 (#2829)
* Tests for v2 to prevent regression of issue from v1

* Linting

---------

Co-authored-by: Ed Henighan <ed.henighan@adi-uk.com>
2024-08-19 21:09:42 +02:00
Carson Gross
97b8c68dd3 release prep 2024-08-05 13:53:08 -06:00
Kyungmin Bae
27412551a5
fix: Fire htmx:trigger event on delayed triggers (#2411)
* Add test on htmx:trigger for delayed triggers

* Fire htmx:trigger event on delayed triggers
2024-08-05 13:47:58 -06:00
Carson Gross
df3fd8fe28 Merge remote-tracking branch 'origin/dev' into dev 2024-08-05 13:46:28 -06:00
Carson Gross
42343d9194 Merge branch 'master' into dev 2024-08-05 13:41:37 -06:00
pokonski
ee9b0e0390
Do not boost forms with method="dialog" (#2752)
* Do not boost forms with method="dialog"

* Clean up
2024-08-05 13:38:51 -06:00
Vincent
941e94fb98
Fix file upload through htmx.ajax (#2778)
* Fix File values handling in formDataFromObject

Fixes #2630

* Test file input upload + htmx.ajax file upload
2024-08-05 13:38:21 -06:00
Carson Gross
084df38c31 only removed templates explicitly used for encapsulating oob swaps
fixes https://github.com/bigskysoftware/htmx/issues/2776
2024-08-05 13:37:31 -06:00
Carson Gross
89dc9bea2e Merge remote-tracking branch 'origin/dev' into dev 2024-08-05 13:12:22 -06:00
Carson Gross
0ace4a731c scan through all siblings (not just until the first non-element) when doing an outerHTML swap to add things to settle
fixes https://github.com/bigskysoftware/htmx/issues/2787
2024-08-05 13:12:13 -06:00
Carson Gross
df16ed8e96 manual test for keeping indicators visible 2024-08-05 12:29:33 -06:00
Carson Gross
e99d8976f5 Manual test to ensure disabled elements are scrubbed when saving history 2024-08-05 12:22:51 -06:00
Ben Croker
a44a1b3c34
Add ability to trigger an event on another element using HX-Trigger response header (#2768)
* Update htmx.js

* Update htmx.js

* Update headers.js

* Update htmx.js

* Update htmx.js

* Update htmx.js

* Update hx-trigger.md
2024-07-29 10:33:24 -06:00
Igor Berlenko
49b5dae073
fixed typo in hx-trigger.js (#2728)
Update hx-trigger.js
2024-07-26 00:27:22 -04:00
Vincent
bec3657a81
Fix: values order with non-GET requests (#2749)
Fix values order with non-GET requests #2703
2024-07-26 00:22:59 -04:00
Carson Gross
f3ae976aa2 fix outerHTML body swapping issue
fixes https://github.com/bigskysoftware/htmx/issues/2639
2024-06-18 10:28:53 -06:00
Carson Gross
1e07206ed2 ignore empty files 2024-05-22 14:53:29 -06:00
Carson Gross
8928efc40a restore tests and dynamic hx-on behavior 2024-05-16 14:16:43 -06:00
Carson Gross
20b42aaf88 Merge branch 'master' into dev
# Conflicts:
#	src/htmx.d.ts
#	src/htmx.js
#	test/core/security.js
#	www/content/docs.md
2024-05-16 12:50:13 -06:00
Denis Palashevskii
dc93911566
Add tests for getSelectors method for extension registration (#2508)
add tests for getSelectors method for extension registration
2024-04-25 13:45:33 -06:00
Carson Gross
b991f20c3a make hx-on respect the hx-disable attribute 2024-04-25 09:49:50 -06:00
Carson Gross
2be7054525 lint 2024-04-17 05:45:40 -06:00
Carson Gross
01cb5e0d8d support hx-on in shadowroot 2024-04-17 05:25:28 -06:00
Carson Gross
ab4e9deabc remove manual tests for extensions 2024-03-26 15:56:40 -06:00
Carson Gross
cd4e6c62cf clean up bad IE references 2024-03-24 14:39:19 -06:00
Carson Gross
d92f165923 lint 2024-03-21 17:35:17 -06:00
Carson Gross
038e1a78f0 Merge branch 'v2.0v2.0' into dev
# Conflicts:
#	dist/htmx.js
#	dist/htmx.min.js
#	dist/htmx.min.js.gz
#	src/htmx.js
#	test/core/ajax.js
#	test/core/regressions.js
#	www/static/src/htmx.js
#	www/themes/htmx-theme/static/js/htmx.js
2024-03-21 17:28:09 -06:00
Vincent
e64238dba3
Fix IE11 incompatibilities (#2408) 2024-03-21 16:06:44 -06:00
Carson Gross
2bab9f4160 Merge branch 'dev' into v2.0v2.0
# Conflicts:
#	dist/ext/sse.js
#	dist/ext/ws.js
#	dist/htmx.d.ts
#	dist/htmx.js
#	dist/htmx.min.js
#	dist/htmx.min.js.gz
#	package.json
#	src/ext/sse.js
#	src/htmx.d.ts
#	src/htmx.js
#	test/attributes/hx-sse.js
#	test/core/regressions.js
#	test/ext/sse.js
#	www/static/src/ext/sse.js
#	www/static/src/htmx.d.ts
#	www/static/src/htmx.js
#	www/static/test/attributes/hx-sse.js
#	www/static/test/core/regressions.js
#	www/static/test/ext/sse.js
#	www/themes/htmx-theme/static/js/htmx.js
2024-03-14 09:11:36 -06:00
Carson Gross
ef791c51eb fix double script execution issue when using template parsing 2024-03-13 18:11:58 -06:00
Vincent
e780175736
Double script exec tests variants using templates: issue confirmed (#2365) 2024-03-13 17:24:02 -06:00
Joe Taber
520502121e
Add config option to ignore nested oob-swaps instead of processing them (#1235)
* Add config option to ignore nested oob swaps

* Fix oobElement root check

* Save config between tests; repeat some tests with different configs

* Add tests for oob-swaps in html, body tags

* Don't unnecessarily change const to var
2024-03-11 12:32:30 -04:00
Carson Gross
9431183cf1 port back double exec tests from 2.x to ensure its not an issue in 1.x, bump version 2024-03-01 15:50:21 -07:00
p.b
d1fc7895f6
Add textContent swap style (#2356)
* feat: add textContent swap style

* add documentation

---------

Co-authored-by: pbt <pb.to@icloud.com>
2024-02-29 11:11:46 -05:00
Vladyslav Tkachenko
21cdfcf17c
SSE Ext #2225: reinstantiate EventSource listeners upon reconnection logic (#2272)
* fix(sse): reinstantiate EventSource listeners
upon reconnection logic

refs #2225

* improve initialization logic of SSE on nested elements

---------

Co-authored-by: Denis Palashevskii <palash.denis@outlook.com>
2024-02-25 23:25:03 +01:00
Denis Palashevskii
1a8afc3502
fix sse-swap removal handling in ext/sse.js (#2247) 2024-02-25 20:58:39 +01:00
Carson Gross
c16758a198 alpha2 2024-02-09 11:13:47 -07:00