Skip to main content

Bug Tracker

Side navigation

#5986 closed bug (fixed)

Opened January 29, 2010 04:46PM UTC

Closed February 02, 2010 02:48AM UTC

Last modified February 05, 2010 09:47PM UTC

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.

Attachments (0)
Change History (4)

Changed January 29, 2010 04:51PM UTC by john comment:1

owner: → john
status: newassigned

Good catch, I'll look in to this.

Changed February 02, 2010 02:48AM UTC by john comment:3

resolution: → fixed
status: assignedclosed

Changed February 05, 2010 09:47PM UTC by john comment:4

component: coremanipulation