-
-
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
htmx.process not fully applying HTMX behaviors to elements in shadowDom #2454
Comments
I think this is because the current code in I sent a pull request #2434 that I think solves the issue. You may want to try it and see if it works for you. |
Thanks andrejota, but still not working with #2434. |
Any chance you could try with |
This is indeed #2406. |
Thanks for the suggestion. I gave that a go, but no difference. |
partially fixed w/ the fix for #2406 (hx-on) I don't know about the nested web components thing, will defer to @kgscialdone who understands web components better than me. |
No, the docs are correct. Either will work, and it was actually quite a chore to ensure that calling
Yes, and at the moment I'm not entirely sure why it isn't. I'll try to look into it more closely when I have the chance. |
I am testing HTMX with web components and have found two issues, which seem to be related to how
htmx.process()
works.Issue 1:
The
hx-on::before-request
attribute is ignored when usinghtmx.process()
as outlined in the docs.Note that this could be related to #2406
Issue 2:
The
hx-get
attribute is ignored whenhtmx.process()
is called on a web component that is a child of another web component.The example code below shows five buttons:
hx-get
andhx-on::before-request
both work.hx-get
works andhx-on::before-request
does not work.htmx.process(buttonEl)
instead ofhtmx.process(root)
.hx-get
andhx-on::before-request
both work.hx-get
andhx-on::before-request
both work.hx-get
does not work (and can't tell ifhx-on::before-request
works).All five button should behave the same: click to show an alert. Buttons 'Not a component', MyComponentAlt and MyButton all work as expected. MyComponent and MyButtonWrapper do not.
I have tried with both HTMX v1.9.11 and v2.0.0-alpha1, with similar results.
I have two questions:
htmx.process(someElement)
instead ofhtmx.process(root)
?htmx.process()
work on nested web components?The text was updated successfully, but these errors were encountered: