Bug Tracker

Opened 11 years ago

Closed 9 years ago

Last modified 7 years ago

#4194 closed bug (fixed)

show() sometimes uses wrong display type

Reported by: jeremy.cloud Owned by:
Priority: high Milestone: 1.4.4
Component: effects Version: 1.3.1
Keywords: Cc:
Blocked by: Blocking:

Description

If you call hide() on an element that already has style="display: none", but which has a CSS declared display value that differs from the default, and then later call show() on that element, the resulting display type of the element is the default display value for that element, rather than the display value specified in the CSS rule.

This is a regression in 1.3.*, as it worked correctly in 1.2.6. I have attached a simple test case that demonstrates this bug.

Attachments (1)

index.html (627 bytes) - added by jeremy.cloud 11 years ago.
Test Case

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by jeremy.cloud

Attachment: index.html added

Test Case

comment:1 Changed 11 years ago by jeremy.cloud

This seems to work as a workaround to this bug:

jQuery.fn.superHide = jQuery.fn.hide;
jQuery.fn.hide = function() {
    return this.each(function() {
        var $this = $(this);
        if ($this.css('display') != 'none') {
            $this.superHide();
        }
    });
};

comment:2 Changed 10 years ago by dmethvin

Component: unfilledfx

comment:3 Changed 9 years ago by Rick Waldron

Milestone: 1.3.21.4.4
Priority: criticalhigh
Resolution: fixed
Status: newclosed

comment:4 Changed 7 years ago by mlhDevelopment@…

I was able to repro - what does that mean?

http://jsfiddle.net/mlhDevelopment/YDhwb/3/

comment:5 Changed 7 years ago by Rick Waldron

Thanks but that test case only proves that doing the wrong thing produces a "broken" result.

Note: See TracTickets for help on using tickets.