Virtual-TreeView icon indicating copy to clipboard operation
Virtual-TreeView copied to clipboard

Vertical Scroll Bar Cannot Scroll To Bottom In Select Circumstances

Open Joshua-Douglas opened this issue 4 years ago • 6 comments

Hello,

I've come across a bug that is preventing users from scrolling to the bottom of a virtual string tree node list in select circumstances. I've attached a sample application that should reveal this issue with the following reproduction steps. This issue was seen with the most recent version of the code base available on GitHub. If need any help reproducing the issue, please let me know.

Reproduction Steps

  • Add a node to an empty virtual string tree
  • Edit the first node's caption so that it is long enough to cause the horizontal scroll bar to show
  • Add additional nodes until the first node is just out of view. Ensure the captions of the new nodes are short enough that a horizontal scroll bar is not needed.
  • Once the longest node is out of view you will note that 1) the horizontal scroll bar is still present, even though all of the nodes in view fit comfortably in the window, and 2) the vertical scroll bar will not allow you to scroll to the bottom
  • If you insert an additional node (or expand the width of the VST window) then the horizontal scroll bar will disappear as expected and the vertical scroll bar will resume working as expected.

Note the following:

  • Before the recent patch to TVTEdit.CreateParams(), an access violation was happening whenever this scrolling issue was triggered.
  • This issue is not unique to the first node. It occurs if any node's name is long enough to show the horizontal scroll bar and if the node with longest name is just out of view.
  • Using the provided sample application I can reproduce the error by naming the first token 'A long node name to fill the entire width of the VST window' and the inserting 6 more tokens. Depending on the resolution settings and custom token window size you may need a longer token name and may need to insert more or less nodes.

VSTScrollingBug.zip

Joshua-Douglas avatar Aug 31 '20 16:08 Joshua-Douglas

Once the longest node is out of view you will note that 1) the horizontal scroll bar is still present, even though all of the nodes in view fit comfortably in the window

I cannot confirm this, tested in RAD Studio 10.3 with latest source. Please note even a 1 pixel line of the long node's row in the view is sufficient for the scrollbar to appear, even if this line does not have any text in it. grafik grafik

joachimmarder avatar Aug 31 '20 20:08 joachimmarder

Hello Joachimmarder,

Thank you for responding so quickly.

I built the sample application on a separate machine with Delphi 10.3 and a fresh clone of the GitHub repo. Unfortunately, I'm still seeing the issue. In the second screenshot you provided, were you able to scroll down to the bottom node without the scroll bar automatically scrolling back up?

I made a 30-second video that shows what I am seeing. Could you take another look and let me know if you still are not seeing the issue shown in the video?

Thanks again for the time and effort, all help is appreciated.

Recording of VST Scroll Bug.zip

Best, Josh

Joshua-Douglas avatar Sep 01 '20 01:09 Joshua-Douglas

OK, the problem occurs if the newly created node appears behind the horizontal scrollbar. Editing the node is not needed. The problem disappears again if another node is created. The problem seems to be in TBaseVirtualTree.ScrollIntoView() in the else-part. I never visited this code myself.

joachimmarder avatar Sep 01 '20 20:09 joachimmarder

I encrountered the same thing. My workaround is to enable AlwaysVisible for the scrollbars.

MHumm avatar Apr 05 '22 12:04 MHumm

I am encountering the same thing. Any updates on fix for this? This makes component unusable when larger amount of nodes are visible.

Best regards, Mladen

timetraveler104 avatar May 08 '23 11:05 timetraveler104

Faced with the same error, fix it please!

EvMac0 avatar Jul 13 '23 12:07 EvMac0