pub struct BringIntoViewRequester {
pub target: Rc<RefCell<Option<u64>>>,
}Expand description
A handle that can programmatically scroll a widget into view.
Create one via remember(BringIntoViewRequester::new), attach it with
Modifier::bring_into_view(requester), and call request
to scroll the attached widget into view on the next frame. The runtime
resolves the target against the current frame and walks its ancestor scroll
containers, dispatching the scroll deltas needed to reveal it.
Fields§
§target: Rc<RefCell<Option<u64>>>Target view id, assigned during layout/paint by the modifier system.
Implementations§
Source§impl BringIntoViewRequester
impl BringIntoViewRequester
pub fn new() -> Self
Sourcepub fn request(&self)
pub fn request(&self)
Request that the associated widget be scrolled into view.
Queued: the request is resolved on the next frame. If the modifier has not been laid out yet the request is dropped.
Sourcepub fn try_request(&self) -> bool
pub fn try_request(&self) -> bool
Enqueue the request, reporting whether a target was available.
Sourcepub fn set_target(&self, id: u64)
pub fn set_target(&self, id: u64)
Assign the view id this requester is attached to. Called by layout.
Sourcepub fn clear_target(&self)
pub fn clear_target(&self)
Drop the current target (e.g. when the widget leaves the tree).