ix-tree unloads items when scrolling down #1470
Labels
type: enhancement
New feature or request
Workflow: Issue created
JIRA issue is created and will be analyzed
Prerequisites
What happened?
While I was working on a feature, I stumbled upon a weird behavior in ix-tree.
Background:
I created a project with many items within the ix tree. This will enable the scrolling for the ix-tree.
I wanted to access the items outside of the visible tree to scroll to them with the following (simplified) code:
element = document.querySelector('[data-tree-node-id="${selectedItemId}"]')
element.scrollIntoview()
This works fine when choosing an element that is currently in the view of the ix-tree as well as elements under the view when scrolling.
An issue arises when trying to access the ix-items in the tree that are currently ABOVE the scrolled position of the view. These elements are unloaded in the DOM.
Trying to access the item with the query selector will now result in receiving null.
The following image shows the tree and its first element at the very top. As you can see, the very first tree item in the developer console is the first item in the tree. All the items below the sample are loaded.
The next image shows the state of the tree when scrolled to the very bottom. Now, the first element in the developer console under the ix-tree element is the node nine. And every item above node 9 was unloaded, making it impossible to get an element with document.queryselector
What type of frontend framework are you seeing the problem on?
Angular
Which version of iX do you use?
v2.4.0
Code to produce this issue.
The text was updated successfully, but these errors were encountered: