Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#7315 closed bug (fixed)

$.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:


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


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

Test case:


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

Change History (5)

comment:1 Changed 6 years ago by rwaldron

  • Component changed from unfiled to css
  • Priority changed from undecided to blocker
  • Status changed from new to open

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


comment:2 Changed 6 years ago by kswedberg

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


comment:3 Changed 6 years ago by snover

  • Milestone changed from 1.5 to 1.4.4
  • Owner set to john
  • Status changed from open to assigned

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

comment:4 Changed 6 years ago by Karl Swedberg

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

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

comment:5 Changed 6 years ago by rwaldron

#5343 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.