Skip to content

Commit

Permalink
Merge pull request #1622 from rs017991/text_input_shift_click
Browse files Browse the repository at this point in the history
TextInput: SHIFT+Left Click to Select
  • Loading branch information
hecrj authored Jan 2, 2023
2 parents fd2ddfa + 280ffd2 commit 54105a2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions native/src/widget/text_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 54105a2

Please sign in to comment.