-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat: code group tab scrollIntoView #2355
Conversation
Can you show a demo of what this does? |
before2023-05-10.23.47.30.movafter2023-05-10.23.49.07.mov |
Ah, for some reason the scrolling isn't smooth if you click the left tab, and it does weird scrolling if one clicks the active tab. Screen.Recording.2023-05-10.at.9.26.33.PM.mov |
let me fix it |
@brc-dd I found this is a bug of vitepress, see the recurrence demo, and I'll fix it in another pr https://vitepress-codegroup-scroll-issue-izayl.vercel.app/markdown-examples.html 2023-05-11.15.09.40.mov |
the scroll problem fixed at #2362 |
it now much better 2023-05-11.21.00.32.mov |
@brc-dd I've made some changes to the code based on your feedback, and I'd appreciate it if you could take another look. |
This thing still doesn't appear to be fixed. For example click the last tab in your example ( The fix at #2362 too isn't valid (left comment there). It will be better to not set scroll behavior smooth. Just something like this should be fine IMO: label?.scrollIntoView({ block: 'nearest' }) |
7ad4a4e
to
f0d3082
Compare
add smooth scrollIntoView when code group is scrollable