-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incomplete support for "data-" prefix #19
Comments
Good catches. Should probably have a test in each attribute test for the "data-" prefix. |
Yep, that probably makes sense. I've added notes in the issue description about the likely fixes. After a bit of experimenting in the browser console It seems like the comma in selectors works as "or" just like in CSS. There might be something more elegant. I added an Htmx binding in Remarker (my server-side rendering library that nobody uses) and decided to use the "data-" prefixed attributes on a lark. Then figured I should check how/whether they work. :) |
fixed by ba6d38e |
clean up uses of getRawAttribute() and add a `data-*` test for all attribute tests.
clean up uses of getRawAttribute() and add a `data-*` test for all attribute tests.
While the docs say that the "data-" prefix is supported for all "hx-" attributes, there appear to be several places in the code that do not honor it. This is based on reviewing the code, not running it. The unit tests don't have coverage for "data-" prefixes, and I haven't reproduced any of these issues.
querySelectorAll("[hx-trigger='revealed']")
querySelectorAll("[hx-trigger='revealed'],[data-hx-trigger='revealed']")
querySelector('[hx-history-elt]')
querySelector("[hx-history-elt],[data-hx-history-elt]")
querySelector('[hx-history-elt]')
querySelector("[hx-history-elt],[data-hx-history-elt]")
The text was updated successfully, but these errors were encountered: