History

Fire click event only when using left button (#3584)

Release Notes: - N/A

Antonio Scandurra committed 2 years ago

Commit 76cea3e2 parents 59d0fea 0b7072b1 file · +1 −0Browse files

Unified · Split

crates/gpui2/src/elements/div.rs+1−0
@@ -964,6 +964,7 @@ impl Interactivity { · 963 unmodified lines
964 let interactive_bounds = interactive_bounds.clone();964 let interactive_bounds = interactive_bounds.clone();
965 cx.on_mouse_event(move |event: &MouseDownEvent, phase, cx| {965 cx.on_mouse_event(move |event: &MouseDownEvent, phase, cx| {
966 if phase == DispatchPhase::Bubble966 if phase == DispatchPhase::Bubble
967 && event.button == MouseButton::Left
967 && interactive_bounds.visibly_contains(&event.position, cx)968 && interactive_bounds.visibly_contains(&event.position, cx)
968 {969 {
969 *pending_mouse_down.borrow_mut() = Some(event.clone());970 *pending_mouse_down.borrow_mut() = Some(event.clone());

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t