bigskysoftware / bigskysoftware/htmx

hx-trigger from:<Extended CSS selector> breaks after target replaced

Open
#2,540 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
49.4k
Forks
1.7k
Avg merge
3d 22h
Merged PRs (30d)
30

Description

I found a strange behaviour of hx-trigger, targeting another element with css selector. When I load the page, the trigger works as expected. But if I change the element it targets, the trigger no longer fires.
This is somewhat understandable, but pretty annoying to be honest.

Here is my sample code:
```html


Change Input

```

Server side, `/input` just returns ``. Nothing special.

Before clicking the button, `/div` fires just fine. But after clicking it, it no longer works.

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.