Skip to main content

SelectionContainer

Function SelectionContainer 

Source
pub fn SelectionContainer(__arg0: Modifier, content: impl FnMut() + 'static)
Expand description

Makes the Text inside content selectable, as Jetpack Compose’s SelectionContainer does.

A mouse selects by dragging; a double click selects a word and a triple click a line, and dragging after either grows the selection by words or lines. A finger resting on a word selects it and then drags to grow the selection, and lifting it opens a Copy / Select all menu. Ctrl+C (Cmd+C on macOS) copies the selection, Ctrl+A (Cmd+A) selects all of this container’s text and Escape clears it. A selection runs across all the texts in the container, in reading order; wrap part of content in DisableSelection to leave it out.

ⓘ
SelectionContainer(Modifier::empty(), || {
    Text("You can long-press and select this text!", Modifier::empty(), TextStyle::default());
});