Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 29a93bd

Browse files
Merge pull request #7296 from bwmilby/bwm-22624-tree-scroll-click
[Bug 22624] Tree View Widget sends click when scrolling
2 parents 7ba420d + c868a8c commit 29a93bd

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# [22624] Do not register click when scrolling (mobileScroller)

extensions/widgets/treeview/treeview.lcb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,7 @@ private variable mIndentPixels as Integer
689689
private variable mHoverRow as Integer
690690
private variable mHoverIcon as String
691691
private variable mMouseDownRow as Integer
692+
private variable mScrolledSinceMouseDown as Boolean
692693

693694
private variable mFrameBorder as Boolean
694695
private variable mShowHover as Boolean
@@ -1156,6 +1157,7 @@ public handler OnMouseDown() returns nothing
11561157
else
11571158
put yPosToRowNumber(the y of the mouse position) into mMouseDownRow
11581159
end if
1160+
put false into mScrolledSinceMouseDown
11591161
end handler
11601162

11611163
public handler OnMouseMove() returns nothing
@@ -1271,6 +1273,11 @@ public handler OnClick() returns nothing
12711273
return
12721274
end if
12731275

1276+
// Just return if top position has changed (view was scrolled)
1277+
if mScrolledSinceMouseDown then
1278+
return
1279+
end if
1280+
12741281
// If the first row was clicked then add a new element
12751282
if mHoverRow is 1 then
12761283
addBaseLevelElement()
@@ -2558,6 +2565,7 @@ end handler
25582565
private handler setViewTopPosition(in pViewTopPosition as Real) returns nothing
25592566
if pViewTopPosition is not mViewTopPosition then
25602567
put pViewTopPosition into mViewTopPosition
2568+
put true into mScrolledSinceMouseDown
25612569
ensureViewTopPosition()
25622570
updateFirstDataItem()
25632571
updateScrollbar(mViewWidth, mViewHeight, mDataHeight, mViewTopPosition)

0 commit comments

Comments
 (0)