Bug Tracker

Opened 7 years ago

Closed 7 years ago

#11913 closed bug (cantfix)

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

Reported by: pnegahdar@… 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"

Change History (1)

comment:1 Changed 7 years ago by dmethvin

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.

Note: See TracTickets for help on using tickets.