You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, scrollToElement relies on the target element's offsetParent to know where to scroll to, however if there are nested positioned elements within a scrollable area it doesn't work as expected.
There are 4 groups of 4 sections, with each group having position: relative.
This means that if I try to scroll to one of the sections, its offset is relative to the parent group, not the scrollable area, so it only works correctly for the first group.
It would be preferable if the offset was somehow determined based on the ng-scrollbar element.
Not sure how feasible it would be to get a reliable generic solution.
Use Case
The example above is very basic and there is no need to have position relative in that example, however if you have more complex markup and need positioned elements then it makes scrollToElement not useful in its current form.
The text was updated successfully, but these errors were encountered:
Feature Description
Currently, scrollToElement relies on the target element's offsetParent to know where to scroll to, however if there are nested positioned elements within a scrollable area it doesn't work as expected.
You can see an example of this in https://stackblitz.com/edit/ngx-scrollbar-he4x18
There are 4 groups of 4 sections, with each group having position: relative.
This means that if I try to scroll to one of the sections, its offset is relative to the parent group, not the scrollable area, so it only works correctly for the first group.
It would be preferable if the offset was somehow determined based on the ng-scrollbar element.
Not sure how feasible it would be to get a reliable generic solution.
Use Case
The example above is very basic and there is no need to have position relative in that example, however if you have more complex markup and need positioned elements then it makes scrollToElement not useful in its current form.
The text was updated successfully, but these errors were encountered: