#[non_exhaustive]pub struct TextSelectionEvent {
pub text: String,
pub start: Option<u32>,
pub bounds: Option<Bounds<Points>>,
pub page_bounds: Option<Bounds<Points>>,
pub anchor: Option<TextSelectionEndpoint>,
pub focus: Option<TextSelectionEndpoint>,
}Expand description
The selection of a selectable view changed
(Interactive::on_text_selection_change).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text: StringThe selected text, as a copy gives it; empty when nothing is selected.
start: Option<u32>Where it starts in the copy of the whole view (what a select all would copy), in UTF-16 code units, when the platform knows it.
bounds: Option<Bounds<Points>>The box around the selected text in the view’s coordinates (its border box), when something is selected and the platform knows it: a bar of actions on the selection goes above it.
page_bounds: Option<Bounds<Points>>The same box in the view’s root view (the surface, or the dialog
around it), as of the event:
crate::overlay::OverlayAnchor::Bounds places an overlay against
it.
anchor: Option<TextSelectionEndpoint>Where the selection started (the press, or the end a key extends
it from), when that is in a list item, as of the event: the
innermost item of a TSX List, else of a Rust component’s list.
None outside list items, and in a row its TSX List has no key
for (its keyExtractor threw or gave neither a string nor a
number).
focus: Option<TextSelectionEndpoint>Where the selection goes (the end a drag or a key moves), when that
is in a list item, as of the event. Before Self::anchor in the
list when the user selected backward.