Scrollbar keeps appearing on load
See original GitHub issueI feel this is a bug that I can’t seem to pin down.
Currently, on load it sometimes is pretty glitchy, and there is this scrollbar that appears, and sometimes flashes, and it disappears as soon as my cursor hovers over the graph. I will have a screenshot below:
Here is the chart, that is wrapped inside of a ResponsiveContainer component:
<ResponsiveContainer width="100%" height={250}>
<BarChart data={this.state.data02}>
<Bar dataKey='sales' fill='#8884d8'/>
<Tooltip />
<XAxis dataKey="date"/>
<YAxis/>
</BarChart>
</ResponsiveContainer>
Recharts version is: 0.22.4 Browser: Chrome on Mac
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Why horizontal scrollbar appears? - Stack Overflow
When I open the site, a horizontal scrollbar appears. I hid it by ::-webkit-scrollbar {display: none;} , but it isn't a good solution ......
Read more >The scroll bar keeps going down - Microsoft Community
Whenever I open an application, the vertical scroll bar just keeps going down and this happens in most of the apps that in...
Read more >Scrollbar appears while page is loading - SharePoint 2013
1 Answer 1 ... You really need to inspect the elements in f12 developer to see what tag is causing the scroll and...
Read more >How to find the cause of horizontal scrollbars - Polypane
There area few common causes for horizontal scrollbars and overflows: ... Loading. The curve on that site extended past the viewport.
Read more >Scrollbar Reflowing | CSS-Tricks
A side-effect when showing scrollbars on the web is that the layout of the content might change depending on the type of scrollbar....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you!
I put this in my main styles.css file. I don’t feel super awesome about it but I’m very happy to not see that scrollbar anymore!!! 😃
/******************************************************************************* ReCharts Fixed with Hacks *******************************************************************************/
:global .recharts-responsive-container div:nth-child(2) { overflow: hidden !important; }
:global .recharts-responsive-container div:nth-child(2) div { overflow: hidden !important; }
(Note: you probably don’t need :global if you copy this hack…but we did)
@arena I mean I did find some CSS hacky thing to get rid of them, but I would still love a better explanation or solution to this issue. Didn’t want to waste so much of my day trying to work on it haha.
I found this div that is a sibling to the recharts-wrapper and it’s two div children of the graph that has overflow set to scroll, and I just set it as hidden in the CSS. Not sure why there was a scroll there in the first place, and it hasn’t impacted me changing it to hidden.
The one highlighted, and it’s two children shown below: