htmx icon indicating copy to clipboard operation
htmx copied to clipboard

Preserves pre-disabled elements with hx-disabled-elt on other element

Open StabbarN opened this issue 4 months ago • 0 comments

Description

Elements with hx-disabled-elt that were already disabled before sending request will now keep the disabled attribute after server has responded or timed out.

A good chunk of the users are probably thinking that this doesn't matter because their html will always swap after request has completed but if they have set htmx.config.timeout the request can time out and elements that are supposed to be disabled will not be disabled anymore.

The attribute data-disabled-by-htmx isn't set if the element already was disabled.

Questions

Should I add a note to the documentation https://htmx.org/attributes/hx-disabled-elt/? Something like "Already disabled elements will not be affected"?

Corresponding issue: https://github.com/bigskysoftware/htmx/issues/3437

Testing

Test added: preserve pre-disabled elements.

Checklist

  • [x] I have read the contribution guidelines
  • [x] I have targeted this PR against the correct branch (master for website changes, dev for source changes)
  • [x] This is either a bugfix, a documentation update, or a new feature that has been explicitly approved via an issue
  • [x] I ran the test suite locally (npm run test) and verified that it succeeded

StabbarN avatar Sep 24 '25 14:09 StabbarN