From 45a47ec4a0fbd47a9714aa77a1257526aeb93fac Mon Sep 17 00:00:00 2001 From: Thomas Hendel <7311310+hendeltom@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:05:19 +0100 Subject: [PATCH] Issue 179 scrolling continues unexpectedly added a check to AbstractSlider._onThumbMouseMove() whether the main mouse button is still pressed; if that is not the case then the scrolling operation is stopped. for this, the DOM event must be checked because MouseEvent.isLeftButtonPressed() does not work for mousemove. --- .../js/rwt/widgets/base/AbstractSlider.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/AbstractSlider.js b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/AbstractSlider.js index 9ae97edc4f..61142e17c2 100644 --- a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/AbstractSlider.js +++ b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/AbstractSlider.js @@ -249,9 +249,14 @@ rwt.qx.Class.define( "rwt.widgets.base.AbstractSlider", { _onThumbMouseMove : function( event ) { event.stopPropagation(); if( this._thumb.getCapture() ) { - var mousePos = this._getMouseOffset( event ); - var newSelection = this._pxToVirtual( mousePos - this._thumbDragOffset ); - this._setSelection( newSelection ); + if( (event.getDomEvent().buttons & 0x01) === 0x01) ) { + var mousePos = this._getMouseOffset( event ); + var newSelection = this._pxToVirtual( mousePos - this._thumbDragOffset ); + this._setSelection( newSelection ); + } else { + this._thumb.setCapture(false); + this._onMouseUp(); + } } },