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

Editor: Fixed sidebar glitch via h scrollable #28467

Merged
merged 6 commits into from
May 24, 2024

Conversation

ycw
Copy link
Contributor

@ycw ycw commented May 23, 2024

This PR fixed sidebar glitch(#28358) by using horizontal scrollable tabs in UITabbedPanel, this approach was suggested by @mrdoob #28358 (comment):

h.scrollable.tabsbar.mp4

Preview: https://raw.githack.com/ycw/three.js/editor-scrollable-tabsbar/editor/index.html

@ycw ycw force-pushed the editor-scrollable-tabsbar branch from 05d155b to e687a6a Compare May 23, 2024 09:56
@@ -1130,6 +1130,7 @@ class UITabbedPanel extends UIDiv {
if ( tab ) {

tab.addClass( 'selected' );
tab.dom.scrollIntoView( { inline: 'center', behavior: 'smooth' } );
Copy link
Owner

Choose a reason for hiding this comment

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

That's nice! I didn't know about this 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

congrats 🎉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that there's an issue when using scrollIntoView in the editor, and its solved by using scrollTo instead, see #28485 🙏🏻 sorry for that.

@mrdoob mrdoob added this to the r165 milestone May 24, 2024
@mrdoob mrdoob merged commit 610cf0b into mrdoob:dev May 24, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants