#5986 closed bug (fixed)
regression: replaceWith treats text only node as selector
Reported by: | iamnoah | Owned by: | john |
---|---|---|---|
Priority: | major | Milestone: | 1.4.2 |
Component: | manipulation | Version: | 1.4.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Given the HTML:
123<div id="foo">Foo</div>456
The code
$('#foo').replaceWith('Bar');
Previously (in 1.3.2) would result in: 123Bar456
Now you get: 123456
The problem is that $(value).detach() is being used internally, which treats the string 'Bar' as a selector instead of a text node. Since it doesn't find anything, the node is just removed.
Change History (4)
comment:1 Changed 13 years ago by
Owner: | set to john |
---|---|
Status: | new → assigned |
comment:2 Changed 13 years ago by
comment:3 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 Changed 13 years ago by
Component: | core → manipulation |
---|
Note: See
TracTickets for help on using
tickets.
Good catch, I'll look in to this.