Bug Tracker

Modify

Ticket #11913 (closed bug: cantfix)

Opened 12 months ago

Last modified 12 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 12 months ago by dmethvin

  • Status changed from new to closed
  • Resolution set to cantfix

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.