Skip to main content

Bug Tracker

Side navigation

#6287 closed bug (wontfix)

Opened March 15, 2010 10:04AM UTC

Closed November 23, 2010 09:16PM UTC

show() hide() bug if element is hidden with css class property

Reported by: orensol Owned by:
Priority: undecided Milestone:
Component: css Version: 1.4.2
Keywords: css, show, hide Cc:
Blocked by: Blocking:
Description

If an element is hidden with a css class, and then you call show() and hide() on the element, it remains with a new style property of "style = 'display: none;'".

This behavior can be unwanted in some cases. hide() in this case should remove the "display" property that was added to the style attribute.

Attachments (1)
  • test-hide.html (0.4 KB) - added by orensol May 11, 2010 11:53AM UTC.
Change History (6)

Changed April 26, 2010 09:48PM UTC by seasoup comment:1

Can you provide a test case?

Changed May 11, 2010 11:54AM UTC by orensol comment:2

Attached test-hide.html, notice how the img is first hidden with the css class .hid, and after show().hide() is called, it is hidden with the element.style.

Changed June 16, 2010 03:43AM UTC by dmethvin comment:3

resolution: → worksforme
status: newclosed

This is intentional. Although it's easy to get the element's css display property, it is harder to know whether it's from a stylesheet or an inline style. Is there some situation where the current behavior breaks something?

Changed July 05, 2010 07:52AM UTC by orensol comment:4

resolution: worksforme
status: closedreopened

Yes, this behavior breaks something.

If that element is hidden because a parent element is hidden, and you have code that somewhere along the way shows the parent element, this child element remains hidden, although the expected result would be it is shown.

Also, it's not that hard to know if the style is inline.

(obj.attr('style').indexOf('display') > -1) should do the trick.

Changed November 12, 2010 02:40AM UTC by snover comment:5

milestone: 1.4.3

Resetting milestone to future.

Changed November 23, 2010 09:16PM UTC by snover comment:6

priority: → undecided
resolution: → wontfix
status: reopenedclosed

Calling hide, show, css, etc. always implies a style override.