Skip to content

Correct description of insertion cloning behavior #438

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

Closed
wants to merge 1 commit into from

Conversation

jugglinmike
Copy link
Contributor

When an element is to be inserted in multiple locations in the DOM, all
four of these manipulation methods behave in the same way: they insert a
clone for all but the last matched location.

From jQuery's implementation of the internal domManip method [1]:

Use the original fragment for the last item instead of the first
because it can end up being emptied incorrectly in certain situations
(#8070).

[1]
https://github.com/jquery/jquery/blob/988d99ad278c2c9dc16c68f86bddc4df99dcd928/src/manipulation.js#L506-L522

When an element is to be inserted in multiple locations in the DOM, all
four of these manipulation methods behave in the same way: they insert a
clone for all but the *last* matched location.

From jQuery's implementation of the internal `domManip` method [1]:

> Use the original fragment for the last item instead of the first
> because it can end up being emptied incorrectly in certain situations
> (#8070).

[1]
https://github.com/jquery/jquery/blob/988d99ad278c2c9dc16c68f86bddc4df99dcd928/src/manipulation.js#L506-L522
@kswedberg kswedberg closed this in 2152cf5 Feb 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant