bigskysoftware / bigskysoftware/htmx

`setAttribute('hx-ignore')` does not disable htmx in 4.0

Open
#4,061 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

Was working with `setAttribute('hx-disable')`, 4.0 upgrade documents claim that this attribute was only "renamed" but there seems to be a behavior change: https://four.htmx.org/docs/whats-new-in-htmx-4

Showcase:

```html

Test

htmx.config.logAll = true;

Ignore next button
Click me
```

Expected: Clicking "Click me" should not make a request after clicking "Ignore next button".
Actual: It makes a request.

Workaround:

Use `htmx.process(element, true)` after setting `hx-ignore`.

```html
Ignore next button
Click me
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the HTML showcase with htmx.config.logAll enabled, then inspect the handling behind htmx.process(element, true) and dynamic hx-ignore changes. Done means setting hx-ignore alone prevents the second button from making a request, without requiring the documented workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.