Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#12441 closed bug (notabug)

.toggle() not working properly with selected descendants that aren't in the DOM

Reported by: Ardemus Owned by:
Priority: low Milestone: None
Component: css Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:

Description

I expect the following code to result in hidden objects.

$Anything.detatch().find('.visibleThings').toggle()
$('body').append($Anything);

However, the appended objects will be visible. All of the versions of jQuery on jsFiddle behaved the same way.

Example Code: http://jsfiddle.net/Ardemus/cYNy5/4/

Change History (3)

comment:1 Changed 7 years ago by mikesherov

Keywords: needsdocs added
Resolution: notabug
Status: newclosed

Thanks for contributing! Unfortunately, detached elements are always considered hidden. Therefore, when you toggle them, they become shown! I'm sure this is a contrived example, but you shouldn't be calling toggle on detached elements.

I'm not sure if our documentation mentions this, so I'll make sure it's updated to reflect this, but this is not currently a bug.

Thanks again for your help!

comment:2 Changed 7 years ago by mikesherov

Component: unfiledcss
Priority: undecidedlow

comment:3 Changed 7 years ago by mikesherov

Keywords: needsdocs removed
Note: See TracTickets for help on using tickets.