diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2013-04-22 21:08:18 -0400 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2013-04-22 21:10:06 -0400 |
commit | d605322c105f4edc37e9a6357af23c4cee53c2cc (patch) | |
tree | 662980587d3f80512b6ca04418d8d6f3fae17b54 /src/manipulation.js | |
parent | 29b0e5202a4d126aa939fc5969eed401c14ae28e (diff) | |
download | jquery-d605322c105f4edc37e9a6357af23c4cee53c2cc.tar.gz jquery-d605322c105f4edc37e9a6357af23c4cee53c2cc.zip |
Fix #13810: .replaceWith(nextSibling)
(cherry picked from commit d8f7e8371230a6dd504ca02e65442745b6ff6ce2)
Diffstat (limited to 'src/manipulation.js')
-rw-r--r-- | src/manipulation.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 8806455eb..0b6a2d7a0 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -207,6 +207,10 @@ jQuery.fn.extend({ parent = args[ i++ ]; if ( parent ) { + // Don't use the snapshot next if it has moved (#13810) + if ( next && next.parentNode !== parent ) { + next = this.nextSibling; + } jQuery( this ).remove(); parent.insertBefore( elem, next ); } |