Side navigation
#12441 closed bug (notabug)
Opened September 02, 2012 07:04AM UTC
Closed September 08, 2012 04:43PM UTC
Last modified October 15, 2012 07:13PM UTC
.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/
Attachments (0)
Change History (3)
Changed September 08, 2012 04:43PM UTC by comment:1
keywords: | → needsdocs |
---|---|
resolution: | → notabug |
status: | new → closed |
Changed September 08, 2012 04:43PM UTC by comment:2
component: | unfiled → css |
---|---|
priority: | undecided → low |
Changed October 15, 2012 07:13PM UTC by comment:3
keywords: | needsdocs |
---|
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!