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
offsetTop fetches the element relative to the top of the nearest relatively positioned element, not relative to the document. If you by chance have a relatively-positioned element in between your navbar and your sections, this causes the scrollto functionality to scroll to the incorrect location.
This can be fixed by using getBoundingClientRect().top (or .y) instead:
Perhaps add a setting for DOM-absolute or relative offsets also, if you consider this a breaking change (I don't think it should be, but I can't test all use cases).
Would you be able to fix this (alternatively I can make a PR) and push a new release to packagist? Thanks!
The text was updated successfully, but these errors were encountered:
Line 99:
offsetTop
fetches the element relative to the top of the nearest relatively positioned element, not relative to the document. If you by chance have a relatively-positioned element in between your navbar and your sections, this causes the scrollto functionality to scroll to the incorrect location.This can be fixed by using
getBoundingClientRect().top
(or.y
) instead:Perhaps add a setting for DOM-absolute or relative offsets also, if you consider this a breaking change (I don't think it should be, but I can't test all use cases).
Would you be able to fix this (alternatively I can make a PR) and push a new release to packagist? Thanks!
The text was updated successfully, but these errors were encountered: