iTwin / appui

Monorepo for iTwin.js AppUi
MIT License
8 stars 2 forks source link

Browser locks up when TreeSelectionManager gets a shift-click for a large number of tree nodes (>200) #462

Closed wilmaier closed 1 year ago

wilmaier commented 1 year ago

Describe the bug The application freezes and the tab needs to be refreshed. Selecting everything by parent node works without issues. This could be related to lazy loading because if I scroll down very slowly and let every node get loaded before selecting the last element then the app does not freeze.

To Reproduce Steps to reproduce the behavior:

  1. Open IModel that would have a few hundred elements
  2. Type 'a' into the search widget field
  3. Expand node with a large amount of elements
  4. Select the first one and scroll down to the bottom and shift+click the last element.

Expected behavior Clicking on the parent node causes all of the child nodes to be added to selection set. Using shift click to select all child nodes should work the same.

Desktop (please complete the applicable information):

grigasp commented 1 year ago

Adding repro steps that are easier to understand:

  1. Go to presentation rules editor.
  2. Select the first node in the tree on the right.
  3. Click on the scrollbar handle and quickly drag it to the bottom.
  4. While holding the Shift key, click on one of the nodes.
  5. Notice the frontend is hung.

2023-08-24_09-51-50

The problem is related to the tree requirement to load all intermediate nodes between the two selected ones.

raplemie commented 1 year ago

Hi! A fix have been done, I'll let you know when it gets released.

raplemie commented 1 year ago

Hi @wilmaier, a fix for this was released today in 4.5.0. Please try it out and let us know if this fixes your issue!

wilmaier commented 1 year ago

Yes thanks. This fixes the issue.

grigasp commented 1 year ago

@raplemie, I guess the issue should be closed?

raplemie commented 1 year ago

Yes, thanks.