666 Commits

Author SHA1 Message Date
Vincent
200c503f31
Removed IE-specific tests (#2039) 2023-11-24 11:30:11 -05:00
Carson Gross
5c42b3442b flip defaults for 2.0 2023-11-21 14:57:52 -07:00
Dan Palmer
0b37d0507d
Fix relative resource URLs for boosted links (#1960)
Fix relative URLs
2023-11-19 07:56:06 -07:00
matiboy
c454ea4eee
Fix WS sendImmediately (#1949)
* Tests at current state of the code

* Currently failing case (actual issue)

* Fix issue

---------

Co-authored-by: mat <matt@techspace.asia>
2023-11-16 13:48:36 -07:00
Jonathan Rietveld
7ef95e8963
Allow CSS selectors with whitespace in hx-trigger (#1913)
* Allow CSS selectors with whitespace in `hx-trigger`

Parsing of `hx-trigger` scans for whitespace, so if a CSS selector is used that contains whitespace, e.g. `form input`, a syntax error is raised.
A workaround is implemented by allowing such a CSS selector to be wrapped in either curly braces or parentheses.

* Add explanation whitespace in CSS selector to docs

* Tests for CSS selectors containing whitespace

* Use faster RegEx test, remove redundant variable declarations

* Added Descendant Combinator support to `root` and `target` modifiers

* Add missing semicolon

* Tests for descendant combinators in `root` and `target` modifiers

* Improve descendant combinator test coverage
2023-11-16 13:45:46 -07:00
gbourant
6a9a861ad9
Allow user to override Content-Type header (#1906)
* allow user to override Content-Type header

* reorder the code so it won't use userSetContentType variable

* remove userSetContentType

* clarification

* remove unrelated changes

---------

Co-authored-by: gbourant <root@gbourant.com>
2023-11-16 13:42:45 -07:00
Jacob Scott
cabff5db14
Add select option to htmx.ajax() (#1985)
adds select to ajax api
2023-11-16 13:37:38 -07:00
Carson Gross
69c053c136 initial inheritance disabling work 2023-11-14 16:27:49 -07:00
Carson Gross
3287445049 make response handling configurable 2023-11-14 14:03:14 -07:00
RBRi
31908e4839
Add missing '})' in core ajax tests (#1998) 2023-11-14 15:27:50 -05:00
Alexander Petros
2c2bf5679f
Remove type:module from package.json (#1968) 2023-11-06 19:00:37 +01:00
Vincent
8ddd079b90
IE11 compatibility fixes (#1948) 2023-11-02 16:40:33 -06:00
Carson Gross
5cd5f927ba Merge branch 'master' into dev 2023-11-02 15:12:37 -06:00
Eric Kwoka
bdcb040a2f
Fix stale form references (#1820)
* 🐛 ensures form reference is accurate

*  Adds test

* 🐛 Fixes null checks

* Revert www updates

This reverts commit d2d14056e2635688fdcb0e6abe572034f77c0bef.

* Revert www updates

This reverts commit 3de585e02997a7877f47ef84f6c2f1a5fcc91ac3.

* ♻️ Refactors code

*  Passes tests
2023-10-31 16:32:58 -06:00
Raphaël Piccolin
fdd2570ac8
fix: prevent nodeData.onHandlers overwrite (#1894)
* fix: prevent nodeData.onHandlers() overwrite

* fix: improved type safety

* test: hx-on handler cleanup

* style: wording

* chore: extra line
2023-10-26 14:45:46 -06:00
matiboy
712ee759f1
Fix confirmed being ignored in htmx:confirm event (#1610)
* Current behavior testing

Testing current library behavior

* Test should remove correct handler

* Add question in htmx:confirm event detail

* Allow skipping window.confirm

* Additional test without hx-confirm value

* Wrap htmx.off in finally

* More correct assertion in case of no calls to confirm

* Remove erroneously added formatting

* Remove erroneously added formatting

* Documentation, fix loop

---------

Co-authored-by: mat <matt@techspace.asia>
2023-10-26 14:43:41 -06:00
Denis Palashevskii
a679244c40
Fix websocket polling trigger (#1903)
fix websocket polling trigger
2023-10-26 11:54:24 -06:00
EliasPrescott
0718daa3ac
Fix: form submission of email inputs with multiple attribute (#1917)
fixing multiple email input values
2023-10-26 11:53:58 -06:00
Alexander Petros
a66a98b9ed
Fix WS/SSE tests and replace go backend with NodeJS (#1876)
* Write WS and SSE test backend in node

* Refactor pages so that the URLs work

* Add tab highlighting script

* Fix stream with multiple events

* Fix highlighting on ext links

* Refactor WS code

* Support event trigger tests

* Add some jitter to the intervals

* Delete old go backend

* Update README with new info and credits

* Update top-level README

* Move ws to dev dependencies

* Remove extraneous go server

* Fix misplace comment
2023-10-12 15:54:40 -05:00
Vincent
7274454360
[New feature] selector-less next and previous targets (#1478)
* nextElementSibling and previousElementSibling target selectors

* Renamed nextElementSibling => next, previousElementSibling => previous
2023-10-06 22:25:03 -06:00
André Rouél
76e0ca1216
Fix Handlebars template rendering (#1836)
Fix Handlebars template rendering (see #801 and #1801)

Co-authored-by: russ4stall <russ@slashpine.tech>
2023-10-06 22:04:58 -06:00
Sam Dudley
355a4fad65
Ignore formmethod when value is "dialog" (#1867)
Fixes #1866
2023-10-06 22:04:02 -06:00
Carson Gross
a5fd1b7081 make singular to make more consistent w/ other attributes 2023-09-21 16:57:28 -06:00
Carson Gross
aa7ae144b5 Merge branch 'master' into dev 2023-09-21 15:48:07 -06:00
Sascha Woo
32b58c41cb
Add support for event cancellation (preventDefault) in extensions (#1456)
ext: add support for event cancellation via preventDefault()
2023-09-21 15:44:42 -06:00
Vincent
bb5413dfd2
[Tests] Fix test pipeline timing issues (#1818)
Fix test pipeline timing issues
2023-09-21 15:43:49 -06:00
Alexander Petros
03b1ebea97
Add version number to test page (#1813)
Now that we only have a single test page, it's helpful to show which
version of htmx the tests are running against.
2023-09-21 12:11:40 -06:00
Sam Dudley
8da65b94e5
Fix swapError with hx-on and innerHTML swap (#1371)
Add tests for hx-on can handle being swapped using innerHTML
2023-09-21 12:11:02 -06:00
Jordan Stewart
59f4da1d9d
fix problem with styles at the start of the server content (#1768)
fix problem with styles at the start of the server content when navigating through history
2023-09-21 12:10:04 -06:00
Vincent
1f55266c47
[Test] Add a test to ensure inputs outside form with form attribute work properly (#1815)
Add a test to ensure inputs external to form work properly
2023-09-21 12:08:51 -06:00
Jyri-Matti Lähteenmäki
048f98c87b
Extend client-side-templates to handle XSLT transformations (#1210)
extend client-side-templates to handle XSLT transformations
2023-09-19 11:08:11 -05:00
Carson Gross
af0dc9c352 add hx-disabled-elts functionality 2023-09-14 13:20:46 -06:00
Sascha Woo
81ac34994a
Support event names with "." character (#1453)
hx-on throws an error when used with event names that contain dots
2023-09-14 10:58:42 -06:00
Sascha Woo
f15795e79c
Allow hx-swap options to be used without specifying modifier (innerHTML remains the default) (#1455)
* hx-swap: make swap style optional

* hx-swap: log an error when an unknown option or modifier is used
2023-09-14 10:57:30 -06:00
Ari
6e93780d8d
Allow disable-element extension to disable multiple elements (#1650)
* Update disable-element extension

Allow multiple elements to be selected in the query

* Remove unnecessary comments

https://github.com/bigskysoftware/htmx/pull/1650#discussion_r1278773982

* Change tab indentations to spaces
2023-09-14 10:47:21 -06:00
Dave Ashby
e3a68c5e1b
Add support for array templates to the client-side templates extension (#1776)
Fix client-side template support for arrays (non-breaking)

Co-authored-by: Dave Ashby <david.h.ashby.ctr@nga.mil>
2023-09-14 10:41:32 -06:00
Jacob Ebey
89f13e6cf2
Support formaction and formmethod on <button> (#1777) 2023-09-14 10:40:39 -06:00
Vincent
55c30b5607
Make htmx IE11 compatible again + tests IE11 compatible (#1687)
* Make htmx IE11 compatible again + tests IE11 compatible

* IE11 compatible handmade socket mock for ws-ext tests

* Fallback when xpath isn't supported, hx-on wildcard now working on IE11

* Merge remote-tracking branch 'upstream/relative-url-in-hx-boost' into ie11-compatibility
2023-09-06 09:55:18 -06:00
Alexander Petros
1763cfc64e
Use raw attribute href on hx-boost (#1742)
This resolves a bug when file system URLs are used on Windows. It
reverts part of a previous change where URLs were normalized prior to
the request in order to reduce key collisions in the history cache.
Because htmx's history cache is based entirely on response URLs, not
request URLs, I am reasonably confident that reverting this line doesn't
affect that optimization at all, but in any case it causes a bug which
is more important.
2023-09-06 09:54:43 -06:00
Carson Gross
c230931d42 support ability to ignore new title tags via config, event and hx-swap 2023-08-31 10:54:47 -06:00
Carson Gross
a9ae4e3e96 Merge remote-tracking branch 'origin/dev' into dev 2023-08-24 12:16:35 -06: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
Denis Palashevskii
212c9fbd3a
[websocket] pass hx-target id in the HEADERS (#1674)
Previously, ws.js used `ws-connect` element as target when collecting request headers.
Now it correctly takes `hx-target` attribute into account
2023-08-24 12:09:22 -06:00
Carson Gross
7247e8abd7 Merge branch 'master' into dev 2023-08-17 10:39:59 -06:00
Alexander Petros
bfd7965dec
Disable logAll in headless mode (#1673)
Enabling logAll in just one test has the capacity to overwhelm the CI
with log output, so we disable it if the webdriver is automated.
2023-08-06 18:06:17 -06:00
Alexander Petros
c126d90588
Move load tests to the bottom of the core file (#1677)
This "resolves" a timing bug that was ocurring in the CI, where these
tests would run before htmx was loaded (only in the GitHub actions
servers). Not proud of this as a fix but I would like the CI to work
again ASAP.
2023-08-05 16:15:49 -06:00
Carson Gross
295d9f83eb remove a logAll() 2023-08-04 17:05:42 -06:00
Carson Gross
14e2a8c611 Merge remote-tracking branch 'origin/dev' into dev 2023-08-04 14:59:19 -06:00
Carson Gross
1acbbe5057 add test to ensure I don't screw up the sameHost value 2023-08-04 14:59:10 -06:00
Alexander Petros
fc4723c95f
Remove logAll from tests (#1657) 2023-08-01 18:04:44 -05:00