Skip to main content

Bug Tracker

Side navigation

#7315 closed bug (fixed)

Opened October 26, 2010 11:45AM UTC

Closed October 26, 2010 09:44PM UTC

Last modified March 10, 2012 01:17AM UTC

$.fn.show fails to show element if element hidden with style rule

Reported by: mechismo Owned by: john
Priority: blocker Milestone: 1.4.4
Component: css Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:
Description

If an element is hidden using a style rule and you call show:

$("#foo").css("display","block").show();

Fails in 1.4.3 - versions < 1.4.3 behave as expected, the element is shown.

**Test case:**

http://jsfiddle.net/RxP32/

Steps to recreate:

**Bug:** Select jQuery version 1.4.3, run and click "Show" button. The element is not shown.

**Expected behaviour:** Select jQuery version < 1.4.3, run and click "Show" button. The element is shown as expected.

I understand setting the style to display:block prior to calling show is counter productive but the behaviour is so different to previous versions it's worthy of a bug

Attachments (0)
Change History (5)

Changed October 26, 2010 01:11PM UTC by rwaldron comment:1

component: unfiledcss
priority: undecidedblocker
status: newopen

Confirmed with 1.4.4rc1 - This is may have huge regression implications

http://jsfiddle.net/rwaldron/RxP32/2/

Changed October 26, 2010 03:03PM UTC by kswedberg comment:2

I've committed a fix for this on github, along with tests. Would appreciate review before I send a pull request:

http://github.com/kswedberg/jquery/commit/a8d0c823f5a09de02f4de85d40f7a38edf63d79d

Changed October 26, 2010 08:32PM UTC by snover comment:3

milestone: 1.51.4.4
owner: → john
status: openassigned

Gonna try to get this landed for 1.4.4. Thanks for catching it, kswedberg!

Changed October 26, 2010 09:44PM UTC by Karl Swedberg comment:4

resolution: → fixed
status: assignedclosed

For .show() with no arguments, only set display of elements in the second loop if they don't have style.display already set or if style.display isn't none. Fixes #7315.

Changeset: 6ab402dced3339d24ad007ecf3a6c3f5af3e7610

Changed October 27, 2010 10:34PM UTC by rwaldron comment:5

#5343 is a duplicate of this ticket.