#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 11 years ago by
Keywords: | needsdocs added |
---|---|
Resolution: | → notabug |
Status: | new → closed |
comment:2 Changed 11 years ago by
Component: | unfiled → css |
---|---|
Priority: | undecided → low |
comment:3 Changed 10 years ago by
Keywords: | needsdocs removed |
---|
Note: See
TracTickets for help on using
tickets.
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!