After checking(selecting) root node, the scrollbar moves to top.
Hi, I recently discovered this bug, and it is pretty annoying.
Current behaviour:
After selecting the root node (with atleast one child) in the tree, the scrollbar moves automatically to top.
It only happens, when the root node has atleast 1 child and only when you are selecting it. How to reproduce - Scroll for example to the end of the 1st tree and select any root node with atleast 1 child.
Expected behaviour:
After selecting the root node (with atleast one child) in the tree, the scrollbar should stay at the same position.
If you for example scroll into the end of the 2nd tree and then select any root node, it stays at the same position, like it should.
Reproduce
Additional Info
- Paste your package.json - "angular-tree-component": "^8.2.0" (everything you can see in the StackBlitz repro)
- Which browser - Tried it on Chrome, Edge, IE, Opera. So I think, this bug is in every browser.
Hi, I had the same issue and I solved it by adding scrollContainer to my options:
options: ITreeOptions = {
scrollContainer: <HTMLElement>document.body
};
@srdex thanks, that helped :), but it should be already fixed by default and not by doing this.
What is the status? Is it gonna be fixed anytime soon?
Try to add 'scrollOnActivate: false' in the options.
Could the scrollContainer value be an expression? Because the scrollable container is initialized at the same time with the tree and there is no way (I wasn't able to find) to change it after init.