aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/textinput.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/textinput.rs')
-rw-r--r--components/script/textinput.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/components/script/textinput.rs b/components/script/textinput.rs
index b4e39eab3f8..d703ccee987 100644
--- a/components/script/textinput.rs
+++ b/components/script/textinput.rs
@@ -513,6 +513,13 @@ impl<T: ClipboardProvider> TextInput<T> {
/// Remove the current selection.
pub fn clear_selection(&mut self) {
self.selection_origin = None;
+ self.selection_direction = SelectionDirection::None;
+ }
+
+ /// Remove the current selection and set the edit point to the end of the content.
+ pub fn clear_selection_to_limit(&mut self) {
+ self.clear_selection();
+ self.adjust_horizontal_to_limit(Direction::Forward, Selection::NotSelected);
}
pub fn adjust_horizontal_by_word(&mut self, direction: Direction, select: Selection) {