How to clear ScrollArea state from memory? #1103
Answered
by
emilk
BctfN0HUK7Yg
asked this question in
Q&A
-
I using one ScrollArea to show selected content. But ScrollArea store previous state from anoter place. I don't want to keep many states with different Ids. I want to have clear SrollArea each selected content. How to do it? With TextEdit I use TextEdit::store_state(ui.ctx(),Id::new("text edit"),TextEditState::default()); when change selected content. Is it possible to do so with ScrollArea? |
Beta Was this translation helpful? Give feedback.
Answered by
emilk
Jan 17, 2022
Replies: 1 comment
-
If it is good enough to clear the let response = ScrollArea::vertical().show(…).response;
ui.ctx().memory().data.remove(response.id); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
BctfN0HUK7Yg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If it is good enough to clear the
ScrollArea
after painting it, you could do: