Skip to main content

Search and Top Navigation

#9120 closed bug (fixed)

Opened February 25, 2013 11:09AM UTC

Closed February 26, 2013 03:36PM UTC

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.

Attachments (0)
Change History (5)

Changed February 25, 2013 12:25PM UTC by tj.vantoll comment:1

owner: → 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.

Changed February 25, 2013 01:06PM UTC by drulia comment:2

_comment0: 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}}}1361797639227286
_comment1: 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/]1361797683725525
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 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/

Changed February 26, 2013 02:29AM UTC by tj.vantoll comment:3

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.

Changed February 26, 2013 03:34PM UTC by scottgonzalez comment:4

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

Changed February 26, 2013 03:36PM UTC by Scott González comment:5

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