Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ix-tree unloads items when scrolling down #1470

Open
2 tasks done
Nakiiii opened this issue Sep 12, 2024 · 2 comments
Open
2 tasks done

ix-tree unloads items when scrolling down #1470

Nakiiii opened this issue Sep 12, 2024 · 2 comments
Labels
type: enhancement New feature or request Workflow: Issue created JIRA issue is created and will be analyzed

Comments

@Nakiiii
Copy link

Nakiiii commented Sep 12, 2024

Prerequisites

  • I have read the Contributing Guidelines.
  • I have not leaked any internal/restricted information like screenshots, videos, code snippets, links etc.

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.

image

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

image

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.

https://github.com/grollmus/ixtreeissue
@Nakiiii Nakiiii added the triage We discuss this topic in our internal weekly label Sep 12, 2024
@danielleroux
Copy link
Collaborator

@Nakiiii this is a intended behaviour, tree items which are not visible will not be attached to the DOM.

@matthiashader matthiashader added type: enhancement New feature or request Workflow: Issue created JIRA issue is created and will be analyzed and removed triage We discuss this topic in our internal weekly labels Sep 17, 2024
Copy link
Contributor

github-actions bot commented Sep 17, 2024

🤖 Hello @Nakiiii

Your issue will be analyzed and is part of our internal workflow.
To get informed about our workflow please checkout the Contributing Guidelines

JIRA: IX-1719

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request Workflow: Issue created JIRA issue is created and will be analyzed
Projects
None yet
Development

No branches or pull requests

3 participants