Skip to content

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

Closed

Description

@thetaPC

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.

Activity

  1. 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[/+] on Jun 15, 2023
  2. averyrousseau commented on Jun 16, 2023

    @averyrousseau
    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?

  3. added
    bug
    on Jun 16, 2023
  4. removed their assignment
    on Jun 20, 2023
  5. thetaPC commented on Jun 22, 2023

    @thetaPC
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions