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

hx-confirm does not work with hx-ws #2470

Open
aral opened this issue Apr 7, 2024 · 0 comments
Open

hx-confirm does not work with hx-ws #2470

aral opened this issue Apr 7, 2024 · 0 comments

Comments

@aral
Copy link
Contributor

aral commented Apr 7, 2024

The WebSocket extension does not respect hx-confirm (a confirmation dialogue is not shown and the WebSocket call is made as if hx-confirm was not specified).

Workaround

Manually implement equivalent functionality on ws-before-send.

e.g.,

<form
  @htmx:ws-before-send='if (!window.confirm("Are you sure?")) $event.preventDefault()'
  
>
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