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

How to add horizontal scrollbar? #13

Open
sk1e opened this issue Aug 17, 2018 · 5 comments
Open

How to add horizontal scrollbar? #13

sk1e opened this issue Aug 17, 2018 · 5 comments

Comments

@sk1e
Copy link

sk1e commented Aug 17, 2018

Does direction param 'h' stand for horizontal scrolling?

With the following code:

  <div style={{ width: 500, height: 100 }}>
    <Baron params={{ direction: 'h' }}>
      <div style={{ width: 2000, height: 2000, background: 'green' }}>
        hello
      </div>
    </Baron>
  </div>

I don't get any scrollbar. With direction value as 'v' I can see a vertical scrollbar.

@Nitive
Copy link

Nitive commented Sep 26, 2018

The reason is undefined in track and bar classes.
After replacing it with _h everything works perfectly.

image

@sk1e
Copy link
Author

sk1e commented Oct 11, 2018

@Nitive oh, that's great. But component API seems to be broken.

P.S. Glad to see a guy from Tomsk here >_<

@Diokuz
Copy link
Owner

Diokuz commented Feb 12, 2019

react-baron uses css-modules here https://github.com/Diokuz/react-baron/blob/master/src/component.js#L17
So, if it is undefined, probably something wrong with your webpack configuration.

@Nitive
Copy link

Nitive commented Feb 12, 2019

Looks like there is no default className for _h in es5 build:
https://github.com/Diokuz/react-baron/blob/master/webpack.config.js#L4-L8
but it has to be:
https://github.com/Diokuz/react-baron/blob/master/src/component.js#L19

@Diokuz
Copy link
Owner

Diokuz commented Apr 25, 2019

Yes, just use hModifier prop to define it. https://github.com/Diokuz/react-baron/blob/master/src/component.js#L70-L71

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

No branches or pull requests

3 participants