From 280ffd26b76170d36e0272cf1a5d8ad66e88ddb1 Mon Sep 17 00:00:00 2001 From: Ryan Scheidter Date: Sun, 25 Dec 2022 11:51:40 -0600 Subject: [PATCH] TextInput: SHIFT+Left Click to Select --- native/src/widget/text_input.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index 05b47ff912..8b4514e3c7 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -454,9 +454,17 @@ where ) } else { None - }; + } + .unwrap_or(0); - state.cursor.move_to(position.unwrap_or(0)); + if state.keyboard_modifiers.shift() { + state.cursor.select_range( + state.cursor.start(value), + position, + ); + } else { + state.cursor.move_to(position); + } state.is_dragging = true; } click::Kind::Double => {