Copy and paste with referenced variable

What are you trying to do? (please be as specific as possible and include relevant screenshots, code snippets)
When you copy a component that has some dynamic value references, you cannot paste it into a new page because of missing references. Even if I add variables with the same name. This is frustrating because you basically cannot copy and paste without disconnecting all dynamic values first. I don’t care if the pasted content gets broken because I will just relink all the dynamic values correctly after pasting it. The benefit is that I don’t have to redo the whole UI or unlink and relink dynamic values on the copied component.

What are the reproduction steps?
Create a UI component, add a dynamic value that references a state or context variable, try to paste it into a new page.

1 Like

Hi, thanks for the suggestion, we will consider this improvement.

@fmota not being able to do this is sometimes nice reminder that what I am pasting should in fact be a reusable component or would have otherwise introduce some messy state variables - agree however that not being able to do it at all means a bit extra work. To keep that valuable thought prompt, perhaps on the paste action a warning with some options of what to do could be used. Something like:

  • Paste UI components only
  • Paste UI components and create new state variables.

This would be similar to when you delete whilst inside a variant recording and it instead hides the element, given the option to delete permanently inside a toast notification.