Opened 10 years ago

Closed 10 years ago

#9120 closed bug (fixed)

Effects: .hide() inconsistent with core with a hidden parent

Reported by: drulia Owned by: drulia
Priority: minor Milestone: 1.10.2
Component: ui.effects.core Version: 1.10.1
Keywords: Cc:
Blocked by: Blocking:

Description

I saw old bug reports about this issue in jQuery itself, which got fixed, but the issue wasn't fixed in jQuery UI.

Here is a JSFiddle http://jsfiddle.net/drulia/BtwJJ/

Basically if the element's parent is hidden, the element doesn't get hidden styles itself, though hide function is executed and callback is called. Also it works properly using jQuery version of hide function. Therefore it makes confusion when function with same name has different behaviours.

Change History (5)

comment:1 Changed 10 years ago by tj.vantoll

Owner: set to drulia
Status: newpending

Hi drulia,

Thanks for taking the time to contribute to the jQuery UI project. Can you please provide some instructions on how to see the problem with your test case. #elem always has display: none; as far as I can tell and I can't reproduce this with a simple test case http://jsfiddle.net/tj_vantoll/mZ8bk/.

Thanks.

comment:2 Changed 10 years ago by drulia

Status: pendingnew

once example loaded try click Hide and Show buttons, you'll see it works as expected, make sure element is visible and then click button Show parent1, there click Hide button again, you'll see status being updated instantly without delay, now go back to parent2 where element will be visible, even though it suppose to be hidden.

Also in your example you using simple hide function, which I assume uses native jQuery function which works as expected, but once you add additional arguments only available in jQuery UI, you'll see console printing block

Here is your example updated - http://jsfiddle.net/drulia/UScJj/

Version 1, edited 10 years ago by drulia (previous) (next) (diff)

comment:3 Changed 10 years ago by tj.vantoll

Status: newopen
Summary: hide doesn't element with hidden parenthide inconsistent with core with a hidden parent

Ok I see the inconsistency now - http://jsfiddle.net/tj_vantoll/tYgzd/. As described UI's hide doesn't apply the display: none inline style if the element has a hidden parent.

comment:4 Changed 10 years ago by Scott González

Component: ui.effects.* (individual effect)ui.effects.core
Milestone: none1.10.2
Summary: hide inconsistent with core with a hidden parentEffects: .hide() inconsistent with core with a hidden parent

comment:5 Changed 10 years ago by Scott González

Resolution: fixed
Status: openclosed

Effects: Delegate to core show/hide when the element is already in the correct final state. This forces the element to go through the olddisplay tracking and forces styles on elements even if they're hidden via an ancestor. Fixes #9120 - Effects: .hide() inconsistent with core with a hidden parent.

Changeset: 948563b8b55802c6d4c513065f1b78bbdcff104c

Note: See TracTickets for help on using tickets.