TextSelection
A range of text that represents a selection.
Properties
-
affinity(TextAffinity | None) –If the text range is collapsed and has more than one visual location (e.g., occurs
-
base_offset(int | None) –The offset at which the selection originates.
-
collapsed(bool | None) –Whether this range is empty (but still potentially placed inside the text).
-
directional(bool | None) –Whether this selection has disambiguated its base and extent.
-
end(int | None) –The next index after the characters in this range.
-
extent_offset(int | None) –The offset at which the selection terminates.
-
normalized(bool | None) –Whether the start of this range precedes the end.
-
selection(str | None) –The text string that is selected.
-
start(int | None) –The index of the first character in the range.
-
valid(bool | None) –Whether this range represents a valid position in the text.
Properties#
affinity
#
affinity: TextAffinity | None = None
If the text range is collapsed and has more than one visual location (e.g., occurs at a line break), which of the two locations to use when painting the caret.
collapsed
#
collapsed: bool | None = None
Whether this range is empty (but still potentially placed inside the text).