Ticket #9120 (closed bug: fixed)

Opened 18 months ago

Last modified 18 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 18 months ago by tj.vantoll

  • Owner set to drulia
  • Status changed from new to pending

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 18 months ago by drulia

  • Status changed from pending to new

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 with no arguments, 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/

Last edited 18 months ago by drulia (previous) (diff)

comment:3 Changed 18 months ago by tj.vantoll

  • Status changed from new to open
  • Summary changed from hide doesn't element with hidden parent to hide 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 18 months ago by scott.gonzalez

  • Summary changed from hide inconsistent with core with a hidden parent to Effects: .hide() inconsistent with core with a hidden parent
  • Component changed from ui.effects.* (individual effect) to ui.effects.core
  • Milestone changed from none to 1.10.2

comment:5 Changed 18 months ago by Scott González

  • Status changed from open to closed
  • Resolution set to fixed

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.