Skip to main content

Bug Tracker

Side navigation

#11913 closed bug (cantfix)

Opened June 14, 2012 06:34PM UTC

Closed June 23, 2012 02:12PM UTC

clone().show() does not revert to original CSS display property, show().clone() does.

Reported by: pnegahdar@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

TEST: http://jsfiddle.net/bsnxp/1/

What it does:

  • Hides the div (you can also start it using display: none on the main div)
  • clone().show() replaces the div html with display: block (not original css display: inline-block)

-show().clone() replaces the div html back to original css display property (inline-block)

What I expected it to do:

-clone.show() should behave like show().clone() and return the original css display property (not block). The jquery documentation on show() states: "except that the display property is restored to whatever it was initially"

Attachments (0)
Change History (1)

Changed June 23, 2012 02:12PM UTC by dmethvin comment:1

resolution: → cantfix
status: newclosed

The knowledge of the previous inline-block state was stored in the .data() of the element you cloned, but you did not specify that the *data* should be cloned. You can either clone the data as well or reverse the order of the methods. There is no other place we can keep that information.