-
Notifications
You must be signed in to change notification settings - Fork 3.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
[#12222] Instructor help page: Page not scrolling to the right section #12224
[#12222] Instructor help page: Page not scrolling to the right section #12224
Conversation
42ba3ee
to
d0b4258
Compare
Still waiting for review |
Open source maintainers on this project are unpaid volunteers with their own work commitments as well. Please be patient on this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @noreddinelam, sorry for the delay! The fix works, but I'm just wondering if it would be better to use a more standard Bootstrap approach. You can refer to this (in particular the .js code)
Edit: Sorry please ignore and refer to @zhaojj2209's reply (:
TEAMMATES makes use of |
@samuelfangjw I am sorry. When i saw in the documentation this : i added the comment but of course i understand what u mean. |
@zhaojj2209 Yeah I noticed that. I tried to use it but unfortunately, It was not working and it was scrolling by like 1cm. As mentioned here ; (an issue opened in the official project) : The issue link if u want to read all the discussion. Now, I found a solution and what was the problem. As mentioned in the issue, they said that the scrolling behavior Here is the solution :
And then we can use the ngx-page-scroll. If u agree with the solution, I can provide a new version of the code. Feel free to give me more hints. |
@noreddinelam Thank you for investigating this issue! Yes, please proceed with the fix. I suspect this will help to resolve scroll issues elsewhere on the site as well. |
fa42069
to
46b1fb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the changes!
Thanks, for the approval. Just a question i think that my branch is out-of-date with the master branch so I don't know If I should click on update branch or let you do it when you merge. |
Feel free to update the branch on your end. Maintainers can do it as well (and we do often update contributor PRs before merging), but that usually means our names will show up as PR co-author. |
46b1fb7
to
647d424
Compare
@zhaojj2209 thanks for explanation and the hints given to resolve this issue. I did update the branch. |
Fixes #12222
Outline of Solution
To resolve this issue, I use to calculate the y coordinate of the section and I used the scrollTo function directly to do it.
The problem was in these two lines :
el.scrollIntoView(); window.scrollBy(0, -50);
The second instruction is not waiting for the first one to finish and do the scroll by -50px.
I removed the '#helpPage' because it is not necessary to get all the children and then search for the section using the id.