Replies: 1 comment
-
Hi @PoshoDev, Copying UI elements is currently not supported. It's probably complicated to get it right, because it's unclear what to copy and what not (e.g. event handlers, children etc.). We'd suggest to use a data model as a source of truth and then create UI elements based on that model. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
Hello there! 😁
I am working on a class of sorts that duplicates elements along its inner rows. The thing is, I'm not exactly sure if I'm on the right path. I noticed the
Element
class has nocopy()
method or similar, so I had to improvise a bit.This is the most minimum reproducible code I was able to put together:
That kinda works, but if then I want to clear the
waitingline
(see commented line on code above) then everything from every container disappears:I've tried fiddling in many other ways by taking hints from the
Element
class methods (move()
,clear()
,delete()
,remove()
) to no avail.I finally got to get it working the way I want by making the
waitingline
invisible (shown where# HACK
is commented), but it doesn't feel like a proper solution and I feel it can lead to problems down the line:What would be the actual proper way for copying elements? Could anyone lend me a hand with this? 🤔
Thanks a lot in advance!
Beta Was this translation helpful? Give feedback.
All reactions