Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show animations, like $.show() $.toggle() and $.slideDown(), don't respect css display property if initial state is display:none; #1774

Closed
mgol opened this issue Oct 21, 2014 · 4 comments

Comments

@mgol
Copy link
Member

@mgol mgol commented Oct 21, 2014

Originally reported by nicholasbg at: http://bugs.jquery.com/ticket/15159

When an element that has a class with a css display property that is not its default (for example a <span> with "display:block"), and has an inline style (like "display:none"), setting it to be displayed with something like $.toggle(200) will cause it to not use the class's display property, while $.toggle() will work properly. Even $.toggle(0) will exhibit this behaviour.

From what I can tell this bug was introduced in 1.11.0/2.1.0

This jsFiddle will demonstrate the bug...  http://jsfiddle.net/e8kpg/

You can see it working normally if you change the jQuery version to something before 1.11.0/2.1.0 or remove the 200 from .toggle(200).

This is a very similar case to...

Ticket #14824 http://bugs.jquery.com/ticket/14824

Issue reported for jQuery 1.11.1

@mgol

This comment has been minimized.

Copy link
Member Author

@mgol mgol commented Oct 21, 2014

Comment author: dmethvin

We have entirely too much magic up in here.

@mgol mgol added the Bug label Oct 21, 2014
@robertmaxrees

This comment has been minimized.

Copy link

@robertmaxrees robertmaxrees commented Dec 12, 2014

Updating to jQuery 1.11.1 shows that this is no longer a bug:
http://jsfiddle.net/robertmaxrees/e8kpg/3/

Also changing to current Edge shows that the bug hasn't returned, as well:
http://jsfiddle.net/robertmaxrees/e8kpg/5/

We might want to close this out accordingly.

@dmethvin dmethvin removed the Bug label Dec 12, 2014
@dmethvin

This comment has been minimized.

Copy link
Member

@dmethvin dmethvin commented Dec 12, 2014

OK then, closing this ticket. Thanks @robertmaxrees !

@nicholasbg

This comment has been minimized.

Copy link

@nicholasbg nicholasbg commented Jul 14, 2015

Sorry for coming late but this bug was not fixed on any 1.x or 2.x version of jQuery. As stated in the bug report, you need to make the inline style display none and to add a duration to see the bug in action.

Here is a fork of robertmaxrees 1.11.1 fiddle with the bug (with the above changes) still happening.
https://jsfiddle.net/e8kpg/6/

The bug is fixed in the edge (currently v3.0.0-pre) and edge compat version though.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.