Skip to content
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

Disable a button while sse connection is active #15

Open
gnituy18 opened this issue Apr 18, 2024 · 0 comments
Open

Disable a button while sse connection is active #15

gnituy18 opened this issue Apr 18, 2024 · 0 comments

Comments

@gnituy18
Copy link

I am trying to disable a button while an SSE connection is actively receiving data. The button, when clicked, requests suggestions generated by an AI. It triggers an SSE connection by retrieving a div element with an hx-ext="sse" attribute.

The hx-disabled-elt attribute does not work for this scenario because the button's action is merely to retrieve the div that initiates the SSE connection.

Is there a proper way to disable the button while the SSE connection is active? Alternatively, is it possible to implement something like an sse-disable-elt attribute?

I am currently using htmx@2.0.0-beta2 and sse@2.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant