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

Clicking on specification menu somtimes highlight incorrect item #1452

Closed
jonaslagoni opened this issue Mar 20, 2023 · 12 comments
Closed

Clicking on specification menu somtimes highlight incorrect item #1452

jonaslagoni opened this issue Mar 20, 2023 · 12 comments
Labels

Comments

@jonaslagoni
Copy link
Member

jonaslagoni commented Mar 20, 2023

Describe the bug

When clicking on something like AsyncAPI Object I would expect that menu to be highlighted instead Schema is. https://www.asyncapi.com/docs/reference/specification/v2.6.0#A2SObject

image

This only happens for some of the links not all.

I have a feeling it's because the article displaying the spec does not take into account the menu is floating once you start scrolling. This means that when I click on AsyncAPI Object I am scrolled to an offset position in the document, instead of placing it in the top of the document, because well there is the menu, hiding the text.

However, the highlighter does not take this into consideration and still finds the nearest heading based on the top of the document, under the menu itself, i.e. finding Schema in this case to be the most likely heading to highlight.

@Savio629
Copy link
Contributor

So AsyncAPI Object comes under Scheme so should the Scheme also be highlighted when it's sub topics is clicked or only it the subtopics like AsyncAPI Object should be highlighted.
@jonaslagoni

@jonaslagoni
Copy link
Member Author

We are not talking about wanting to highlight Schema when AsyncAPI Object is clicked.

Schema should NOT be highlighted when I click AsyncAPI Object instead AsyncAPI Object should be highlighted 🙂

@Savio629
Copy link
Contributor

@jonaslagoni It would only be highlighted when someone clicks on it or it is in it's corresponding div section, right? However, the Schema and AsyncAPI Object may contain different amounts of information, so when a user is in their respective div sections, both may be highlighted depending on the amount of content in each. I apologize for any confusion my previous response may have caused.

@jonaslagoni
Copy link
Member Author

@jonaslagoni It would only be highlighted when someone clicks on it or it is in it's corresponding div section, right?

Yes.

However, the Schema and AsyncAPI Object may contain different amounts of information, so when a user is in their respective div sections, both may be highlighted depending on the amount of content in each

No, there is always just one being highlighted, even if both is in view 🙂

@Savio629
Copy link
Contributor

So in this issue I would look on highlighting the AsyncAPI object when it's clicked rather than highlighting Schema .

@jonaslagoni
Copy link
Member Author

Correct @Savio629 👍

@Savio629
Copy link
Contributor

I'll start working on it!
Thanks for the info.

@Savio629
Copy link
Contributor

@jonaslagoni
The npm package(react-scrollspy) that was being used for rendering the table of content of divs present on the screen by the website is now deprecated.
Should we still keep using it?

@jonaslagoni
Copy link
Member Author

@Savio629 I would ping the codeowners for that question 🙂

@sambhavgupta0705
Copy link
Member

@jonaslagoni we can close this issue now

@Savio629
Copy link
Contributor

@sambhavgupta0705 I feel we can close this issue now....

@sambhavgupta0705
Copy link
Member

Yes ,@jonaslagoni

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants