Skip to content

Resetting values in repeated elements #3400

Answered by farmaazon
farmaazon asked this question in Q&A
Discussion options

You must be logged in to vote

I develop a dirty workaround, posting it here in case anybody would be interested:

  1. In some accessible place (e.g. global singleton) declare a bool property (let's say "resetting") and a callback ("reset")
  2. Implement the callback in Rust: set the property to true and start single-shot timer with 0 duration which will set it back to false.
  3. make the element containing repeated elements conditional: if !resetting:
  4. Call the callback in places where you want to restore bindings.

The UI will blink for a moment, but bindings will be restored. And I guess it is far from best performance, therefore I can't wait for two-way bindings!

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@farmaazon
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by farmaazon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants