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
BrowserViewportScroller not honoring native scroll margin #55383
Comments
This looks more like a |
That would be the function that needs to change for this bug to be fixed. And I call it out as a bug because intuitively the behavior of this scrollTo should match the native behavior of hashes. The scrollMargin css property exists precisely because of the sticky and fixed headers. The offset property can remain for backwards compatibility, but the properties need to be honored because that's why they exist. They are honored by all browsers except IE. The below should work. I'll look into figuring out how to do a pull request over the weekend.
|
Right, I agree.
This, historically, would be the reason the issue exists. The implementation here has existed since before IE was dropped and potentially before the current set of browsers all fully supported it as well. |
This is the account that I will be issuing the PR from. I'll look up the guidelines and try to get something in on Saturday. I imagine test revision will be the largest segment. |
Which @angular/* package(s) are the source of the bug?
router
Is this a regression?
No
Description
Angular ignores the scroll margin property - particularly scroll-margin-top, instead always scrolling the target to 0,0. The native HTML anchor scrolling honors this property, so this behavior must be considered a bug.
Please provide a link to a minimal reproduction of the bug
This is a userland solution to the bug, at least for scrollMarginTop (which is the most common use case)
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response
The text was updated successfully, but these errors were encountered: