Skip to content

hx-trigger with custom event triggers on other events #3245

Answered by Telroshan
BrendanMartin asked this question in Q&A
Discussion options

You must be logged in to vote

Hey,
hx-vals is inherited by default, which is likely why you're getting it evaluated for the child input ; I think that instead of being the parent div that gets its hx-vals evaluated, it's simply the input that inherits the hx-vals from its parent div, thus gets its evaluated for itself.
I think you could add hx-vals="unset" to your input to fix this

Also, is it expected to use hx-trigger="changed" here? You might want to use the standard event change instead, as changed is a modifier keyword that htmx supports, but that still has to complement an event name

Hope this helps!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by BrendanMartin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants