Skip to content

Commit

Permalink
TextInput: SHIFT+Left Click to Select
Browse files Browse the repository at this point in the history
  • Loading branch information
rs017991 committed Dec 25, 2022
1 parent a6d0d57 commit 999a0e3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions native/src/widget/text_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,15 @@ 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 => {
Expand Down

0 comments on commit 999a0e3

Please sign in to comment.