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

graft operation #103

Merged
merged 2 commits into from
Jan 24, 2021
Merged

graft operation #103

merged 2 commits into from
Jan 24, 2021

Conversation

leastbad
Copy link
Contributor

@leastbad leastbad commented Jan 23, 2021

The PR came to me in a dream.

The graft operation makes it possible to transplant one or several elements from their initial location in the DOM hierarchy and append them to a new parent container element. This is exciting because you can perform this action and not lose the internal state of any Stimulus controllers on the target element or its children.

A Stimulus controller attached to a grafted element will disconnect and then re-connect as expected.

The operation is cancelable and acceptsparent and focus_selector keys. parent is a CSS query that matches a single DOM element; if no element is returned, the operation is aborted.

@leastbad leastbad merged commit 3d4bde1 into stimulusreflex:master Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant