-
With stateful widgets this wasn't a problem because the developer decided whether to assign the same state to a widget or not, but now I wonder how does Iced decide whether my focused TextInput should remain focused in the next render. I'm experiencing an issue where my TextInput is losing focus as I write into it because some other widgets appear/disappear depending on what's written, but since the widget tree changes I suspect Iced is basing this decision on the TextInput's position in the tree. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Yep. Iced just assumes based by itterating through each widget's children recursively. Give the text input widget an |
Beta Was this translation helpful? Give feedback.
Yep. Iced just assumes based by itterating through each widget's children recursively.
Give the text input widget an
.id()
and after each event created by the text input just also return a focus widget operation, that should keep the text input in focus even with layout changeshttps://github.com/iced-rs/iced/blob/master/examples/todos/src/main.rs#L102