Skip to content

bug: scroll to the right button renders for short lists on playground #2999

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

Closed
thetaPC opened this issue Jun 15, 2023 · 2 comments · Fixed by #3009
Closed

bug: scroll to the right button renders for short lists on playground #2999

thetaPC opened this issue Jun 15, 2023 · 2 comments · Fixed by #3009
Labels
bug Issues related to bugs on the documentation website

Comments

@thetaPC
Copy link
Contributor

thetaPC commented Jun 15, 2023

Describe the Bug

The playground files will render a scroll to the right button when the the files view overflows (which makes sense):
Screenshot 2023-06-15 at 1 12 50 PM

However, when I select a different framework that doesn't overflow, then the scroll to the right button still shows. This only happens when at least one framework has tabs that overflow.
Screenshot 2023-06-15 at 1 19 02 PM

Expected Behavior

I expect to not see the scroll to the right button when the current tabs don't overflow.

Screenshot 2023-06-15 at 1 18 38 PM

Steps to Reproduce

  1. Navigate to the Action Sheet -> "Collecting Role Information on Dismiss" section
  2. Verify that Angular is selected
  3. Verify the scroll to the right button renders
  4. Click on React
  5. Notice the scroll to the right button is still present
  6. Navigate to the Action Sheet -> "Styling"
  7. Notice that the Angular doesn't render the scroll to the right button
  8. Click on React
  9. Notice the scroll to the right button is not rendered

Screenshots

With bug:
Angular
Screenshot 2023-06-15 at 1 12 50 PM

React
Screenshot 2023-06-15 at 1 19 02 PM

Without bug:
Angular
Screenshot 2023-06-15 at 1 24 02 PM

React
Screenshot 2023-06-15 at 1 18 38 PM

Operating System

macOS

Browser

Firefox

Version

114.0.1

Additional Information

The code source can be found in the PlaygrounTabs index file.

@thetaPC thetaPC added the triage New issues label Jun 15, 2023
@thetaPC thetaPC changed the title bug: scroll to the right button renders for short list on playground bug: scroll to the right button renders for short lists on playground Jun 15, 2023
@averyjohnston averyjohnston self-assigned this Jun 16, 2023
@averyjohnston
Copy link
Contributor

Thanks! I'm able to reproduce this. It looks like we need to re-update the navVisible states whenever the selected framework changes. (Theoretically, this should be as simple as adding selectedValue to the array passed into the useEffect here.)

Right now, the scroll buttons are only updated on init and on scroll in the file list, so I suspect that whether they're set initially is dependent entirely on the Angular files, since Angular is the default. Thankfully, Angular generally has the most files, so we're less likely to have the opposite situation where you should be able to scroll but can't. That will change if we implement #2798, though, so we should definitely fix this before then.

Side note: I actually didn't see the bug trigger on my first try, but every subsequent refresh (including incognito) did trigger it. Maybe I just clicked on React too fast the first time?

@averyjohnston averyjohnston added the bug Issues related to bugs on the documentation website label Jun 16, 2023
@ionitron-bot ionitron-bot bot removed the triage New issues label Jun 16, 2023
@averyjohnston averyjohnston removed their assignment Jun 20, 2023
@thetaPC
Copy link
Contributor Author

thetaPC commented Jun 22, 2023

This will be available on the site soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs on the documentation website
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants