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

5.1.x scrollbars do not scroll and exhibit strange behavior with external mice #6753

Closed
domyen opened this issue May 9, 2019 · 18 comments
Closed
Labels
Milestone

Comments

@domyen
Copy link
Member

domyen commented May 9, 2019

Describe the bug

  • Scrolling does not scroll
  • Scrollbars remain visible when using an external mouse (i.e., in a desktop setup)

To Reproduce
Steps to reproduce the behavior:

  1. Go to Storybook next branch. View the default story or the about page
  2. See that scroll bars render strangely on in the default Storybook UI. And notice you cannot scroll on the about page.

Expected behavior

  • I expect the scrollbar to not have artifacts
  • I expect the scrollbar to scroll

Screenshots
Image of broken scrollbar:
image

Video recording of scrolling not working on about page:
Screen Recording 2019-05-09 at 04 47 PM

System:

  • OS: Mac OSX Mojave
  • Device: Macbook Pro 2018
  • Mouse: Microsoft Intellimouse
  • Browser: Chrome
  • Version: 5.1.X

Additional context
This regression was introduced in 5.1.x. I've seen the visible scrollbars happen when simplebar is broken -- perhaps the update to simplebar-react 1.0-alpha could have caused this? This behavior does not exist in my 5.0.x Storybooks.

@ymcnicoll
Copy link

This behavior also shows on Windows machines.

This started to happen when I upgraded from alpha.31 to alpha.40

@shilman shilman added this to the 5.1.0 milestone May 9, 2019
@Grsmto
Copy link

Grsmto commented May 10, 2019

Hi,
SimpleBar maintainer here, I'll look into this, I think this is a bug on our side. I think I know the cause but I'm still unsure on why this is happening as the usage in Storybook seems quite straightforward.

Video recording of scrolling not working on about page:

After debugging quickly this, it seems like it's unrelated to SimpleBar and it's a z-index issue. An element on top is blocking any mouse interaction.

@Grsmto
Copy link

Grsmto commented May 10, 2019

So after investigation, this is because SimpleBar V4 has CSS changes that have not been updated in Storybook. It's just that you have hardcoded the core CSS of SimpleBar in this file so the CSS in there is outdated!

You should just have to update the CSS to the latest SimpleBar version and that should work again fine.

Thanks for using SimpleBar, please don't hesitate to file an issue in our repo if you encounter anything!

@shilman
Copy link
Member

shilman commented May 10, 2019

Thanks so much @Grsmto ! Much appreciated!

@artyomtrityak
Copy link

Having similar issue on Mac 5.1-beta0

Storybook (1)
Storybook

@domyen
Copy link
Member Author

domyen commented May 11, 2019

Thanks @Grsmto 🙏. I totally forgot about that hack 😅, will have to figure out why we ended up doing that - a setting-specific reason I'm sure.

Edit: I remember now, we want to pass the user's theme vars to Simplebar. Is there a way to override certain styles in simplebar?

@domyen
Copy link
Member Author

domyen commented May 14, 2019

Tried to debug this using @Grsmto's suggestion to update the CSS; that ended up causing different layout bugs. @ndelangen can you lend a hand here?

Check out ScrollArea stories to isolate the issue.

On next I tried applying the styles to Global like so:

<Global
      styles={css`...styles pasted from simplebar.css v4.0 for test purposes`} /> 

The horizontal scrolling works. It does not work with vertical scrolling by itself or in combination with horizontal scrolling

Screen Recording 2019-05-14 at 11 27 AM

@ndelangen
Copy link
Member

I'm on it

@ndelangen
Copy link
Member

@artyomtrityak are you on our discord by any chance?
https://discord.gg/sMFvFsG

@Grsmto
Copy link

Grsmto commented May 14, 2019

Make sure to apply the right css properties on the host (element on which you apply SimpleBar). As it doesn't do it for you anymore (that's a breaking change on V4).
So for ex for the left sidebar it won't work unless you define height: 100%; on the element.

Edit: reason is that before SimpleBar has height: inherit and doesn't anymore.
So if you don't apply dimensions to the host element, it just overflows from its parent. Like normal CSS behaviour.
What you can do is apply max-height: inherit; to have the previous behaviour or just apply the CSS directly on the host element instead of having a wrapper like it's done at the moment. Hope this help!

@Grsmto
Copy link

Grsmto commented May 14, 2019

If you guys struggle let me know and I could work on a PR!
I had a quick look and was able to fix it with the tips I provided in my previous comment.

@ndelangen
Copy link
Member

@Grsmto I'm running into a problem where (at least on my machine, I can't scroll all the way to the right, when scrolling on both axis:

I can reproduce this on http://grsmto.github.io/simplebar/examples too

@Grsmto
Copy link

Grsmto commented May 14, 2019

@ndelangen what we can see in the video is actually the "normal" behaviour. If you check when you're testing the "Both axis + padding native" it's having the exact same behaviour.
If you apply a padding inside an overflow: auto element, the browser does not take that padding into account for the padding-right. I'm not sure exactly why but that's the native CSS behaviour!

If you want to fix this "issue" you can just apply the padding to an inner element instead of applying it on your SimpleBar host element.

@ndelangen
Copy link
Member

browsers suck

@ndelangen
Copy link
Member

@domyen or anyone else, are you able to confirm the issue is resolved in my PR?
#6785

@artyomtrityak
Copy link

@ndelangen yes i am :)

@domyen
Copy link
Member Author

domyen commented May 16, 2019

Added theming support back in #6794. can @ndelangen or anyone confirm 🙏

@shilman
Copy link
Member

shilman commented May 16, 2019

w00t!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-beta.1 containing PR #6794 that references this issue. Upgrade today to try it out!

Because it's a pre-release you can find it on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants