Skip to content

htmx throws exception on certain hx-trigger="sse:event/names" #2731

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

You must be logged in to vote

Hey, unfortunately there's no support for event names containing spaces for now in hx-trigger. Spaces are used as separators as you mentioned, to process modifiers.
In this case you will probably want to simply send events that don't contain any space from your backend.
Relevant line of code in the lib btw:

htmx/src/htmx.js

Line 2120 in 1c1e4fa

const trigger = consumeUntil(tokens, /[,\[\s]/)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hspaay
Comment options

Answer selected by hspaay
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