Skip to content

Fix hx-live take to default to sibling scope#3816

Open
MichaelWest22 wants to merge 1 commit into
bigskysoftware:four-devfrom
MichaelWest22:take-scope
Open

Fix hx-live take to default to sibling scope#3816
MichaelWest22 wants to merge 1 commit into
bigskysoftware:four-devfrom
MichaelWest22:take-scope

Conversation

@MichaelWest22
Copy link
Copy Markdown
Collaborator

@MichaelWest22 MichaelWest22 commented May 31, 2026

Description

Recent improvements to hx-live have changed the default scope behavior of the take helper. It now defaults to take from the whole page which could be a risky default. The normal take case is to take a class or selection etc from your siblings in a list so it defaults to searching for the class inside the parentElement and removing the class from here and placing it on the selected element. So I've reverted to this old behavior which I think makes more sense.

Corresponding issue:

Testing

Added tests for the default take from sibling case and removed the default from whole page test.

Checklist

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

@MichaelWest22 MichaelWest22 added the htmx 4 Issues specific to htmx version 4 label May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

htmx 4 Issues specific to htmx version 4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant