From 2efe580cb8dbd185fc154a7c7d6acb7efc4f16d5 Mon Sep 17 00:00:00 2001 From: Teemu Pòˆntelin Date: Sun, 4 May 2014 17:12:54 +0300 Subject: Fast-forward DateField only with left mouse button (#8012) Change-Id: Ib21c650feeed1ca584b2aeefb6c694e73e12b90d --- client/src/com/vaadin/client/ui/VCalendarPanel.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'client/src') diff --git a/client/src/com/vaadin/client/ui/VCalendarPanel.java b/client/src/com/vaadin/client/ui/VCalendarPanel.java index 74462e501d..0725e15f66 100644 --- a/client/src/com/vaadin/client/ui/VCalendarPanel.java +++ b/client/src/com/vaadin/client/ui/VCalendarPanel.java @@ -22,6 +22,7 @@ import java.util.Iterator; import com.google.gwt.aria.client.Roles; import com.google.gwt.aria.client.SelectedValue; import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.dom.client.Node; import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler; @@ -1498,11 +1499,12 @@ public class VCalendarPanel extends FocusableFlexTable implements */ @Override public void onMouseDown(MouseDownEvent event) { - // Allow user to click-n-hold for fast-forward or fast-rewind. + // Click-n-hold the left mouse button for fast-forward or fast-rewind. // Timer is first used for a 500ms delay after mousedown. After that has // elapsed, another timer is triggered to go off every 150ms. Both // timers are cancelled on mouseup or mouseout. - if (event.getSource() instanceof VEventButton) { + if (event.getNativeButton() == NativeEvent.BUTTON_LEFT + && event.getSource() instanceof VEventButton) { final VEventButton sender = (VEventButton) event.getSource(); processClickEvent(sender); mouseTimer = new Timer() { -- cgit v1.2.3