Skip to content
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

Fix docs navigator not scrolling into open type on page load #6420

Merged
merged 1 commit into from Aug 2, 2018

Conversation

soanvig
Copy link
Contributor

@soanvig soanvig commented Jul 20, 2018

This fix really annoying issue: browsing through API docs requires constantly scrolling through type navigator.

According to @straight-shoota, this function worked before #5229.

I've created my own implementation of that function. It identifies open item by .current class, and selects last of it (to handle case of nested items).

Used function .scrollIntoView() browser compatibility: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView

Function was tested locally and it works, but one may test by himself.

@soanvig soanvig changed the title Fix docs navigator not scrolling into selected element on page load Fix docs navigator not scrolling into open type on page load Jul 20, 2018
@straight-shoota
Copy link
Member

You can take a look at https://crystal-lang.org/api/0.24.1/ to see it working before.

It didn't actually scroll the current element to top but preserved the previous viewport. I think that's better, but it would need to work with the search results list which has a different view port.
The proposed implementation is good, though, and certainly an improvement.

@soanvig
Copy link
Contributor Author

soanvig commented Jul 26, 2018

So, is this going to be merged or not? Not sure about the process.

Copy link
Member

@sdogruyol sdogruyol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @soanvig 👍

@sdogruyol sdogruyol merged commit 1064d76 into crystal-lang:master Aug 2, 2018
@sdogruyol sdogruyol added this to the 0.26.0 milestone Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants