bigskysoftware / bigskysoftware/htmx-extensions

Disable a button while sse connection is active

Open
#15 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
284
Forks
88
PR merge metrics
No merged PRs in 30d

Description

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`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.