editor: Add delay for selection drag to prevent accidental drag over attempt for new selection (#32586)
- Add `300ms` delay for it to consider it as selection drag instead of an attempt to make a new selection. - Add cursor icon while dragging the selection. This is same as what chromium does: https://chromium.googlesource.com/chromium/blink/+/master/Source/core/input/EventHandler.cpp#142 Release Notes: - Fixed issue where you accidentally end up dragging the selection where intent was to make a new one instead. To drag selection now, you need to hold just a little longer before dragging.
This commit is contained in:
@@ -912,6 +912,7 @@ enum SelectionDragState {
|
||||
ReadyToDrag {
|
||||
selection: Selection<Anchor>,
|
||||
click_position: gpui::Point<Pixels>,
|
||||
mouse_down_time: Instant,
|
||||
},
|
||||
/// State when the mouse is dragging the selection in the editor.
|
||||
Dragging {
|
||||
|
||||
Reference in New Issue
Block a user