-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Clicking the menu doesn't work correctly with scrollYOffset set #748
Comments
@RomanGotsiy Any news or plans on this? |
Thanks for the investigation! |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've got a ReDoc instance running with scrollYOffset set to an header element, see https://open-eo.github.io/openeo-api/v/0.4.0/apireference/index.html
Clicking on the menu items doesn't work in many cases, it is opening the correct menu item for a short period of time and then shows the one above it (may be even in another group). For example, you can try clicking "EO Data Discovery".
I think I found the issue while debugging a bit. The problem occurs if you specify an element for the scrollYOffset which el.getBoundingClientRect().bottom returns a non-integer number for. It seems that in some places it works on integers and in some on floating point numbers and this leads to imprecision when calculation the scrolling position and the active menu item. Using Math.ceil or Math.round in normalizeScrollYOffset solved the problem for me. So I'd suggest only allowing integers as scrollYOffset and ensure in code that it is always an integer.
Hope this can be solved soon, thanks in advance!
Some version numbers:
ReDoc version: 2.0.0-rc.0
Chrome: Version 70.0.3538.110 (Windows)
The text was updated successfully, but these errors were encountered: