Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloning element does not clone the inline styles from code #218

Closed
SamCZ opened this issue Jul 31, 2021 · 2 comments
Closed

Cloning element does not clone the inline styles from code #218

SamCZ opened this issue Jul 31, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@SamCZ
Copy link

SamCZ commented Jul 31, 2021

Cloning element does not clone the styles (Element::meta)

How to reproduce:

  • Create element in code
  • Set some property through SetProperty()
  • Clone the element and attach it to some other element

Result:

  • Element doest not have set properties and use just loaded css from document

Expected result:

  • Element is cloned with all attributes and properties

I just found this problem when trying to set drag element style in code, when you drag the element in game, it clones it and just use the original css from file and the inline style is erased.
Point of clone: Context.cpp::1208

Edit: Maybe #191 similiar problem ?

@mikke89 mikke89 added the bug Something isn't working label Aug 4, 2021
@mikke89
Copy link
Owner

mikke89 commented Aug 5, 2021

Thanks for reporting!

The main issue here is that the style attribute is not kept in sync with manually set properties. Thus, when the element was cloned, only styles set using the style attribute would be cloned, but manually set styles using SetProperty would not be cloned (see also related PR #177). I've changed this now so that all inline styles are manually copied over.

Hopefully this should fix the issue, let me know!

@SamCZ
Copy link
Author

SamCZ commented Aug 9, 2021

Hi, it works now, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants