Modify ↓
Ticket #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: | ||
| 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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

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.