question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Table's Style props should override overflow: 'hidden'

See original GitHub issue

Requesting a Feature

It should be possible to override the overflow: hidden style in a table. I would like to have a button on each row that opens a dropdown. However, the dropdown is currently hidden because it overflows the row.

In the Chrome developer tools, I can see the dropdown if I manually remove overflow:hidden from .ReactVirtualized__Table__row and .ReactVirtualized__Table__rowColumn. However, I have not found a way to do this with either javascript or css.

Looking at source/Table/Table.js, it seems that overflow: hidden is set in-line and overrides the style prop. The style prop should have precedence. Having hidden overflow is a good default, but there are cases when this is not optimal

    const flattenedStyle = {
      ...style,
      ...rowStyleObject,
      height: this._getRowHeight(index),
      overflow: 'hidden',
      paddingRight: scrollbarWidth,
    };

I have looked into work arounds, such as React Portal. However, built in portal features are not available in React 15 and including another entire library to work around this small issue, giving built in style precedence over the style prop, seems unnecessary.

This is what the row currently looks like (with the dropdown expanded): screen shot 2017-11-16 at 12 25 54 pm

This is what the row should look like (with the dropdown expanded): screen shot 2017-11-16 at 12 27 32 pm

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
SocialHulkHogancommented, Feb 20, 2018

I’d like to second this request. I’m in a similar situation where I need a color picking interface to pop out, and I’d rather the horizontal overflow be visible rather than having to expand the width to fit the colorpicker. That’s how I handle the issue now, but it makes the table too wide considering I also need a graph on this page. I don’t see any harm in allowing a column’s style prop to set the overflow to be visible. Admittedly, I’ve only been using React for about 3 months so anytime I can just do what I want without having to learn work arounds is greatly appreciated.

Edit: For anyone else with the issue, an even better work around would be to add a class to the column you want to see overflow on with the className prop, then in a style sheet set overflow: visible !important. Still feels like an unnecessary hack though, and I’d like to see this change implemented. Creates some hassle for devs concerned with page space and doesn’t feel intentional. I thought the overflow property was like this for a reason, but seeing as changing it breaks nothing I can’t help but feel it was just a mistake.

5reactions
omiceroncommented, Mar 29, 2019

Overriding styles helped me. I put it in my table component stylesheet:

.ReactVirtualized__Grid__innerScrollContainer {
    overflow: visible !important;
}

.ReactVirtualized__Table__row {
    overflow: visible !important;
}

And a Column component should be with this style

.column {
    overflow: visible !important;
}
<Column
  className = 'column'
  label = 'column'
  dataKey = 'column'
  width = {150}
  cellRenderer = {cellRenderer}
/>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Override the overflow: hidden style - css
Is it possible to override the overflow: hidden style in a table? I would like to have a button on each row that...
Read more >
overflow - CSS: Cascading Style Sheets - MDN Web Docs
The overflow CSS shorthand property sets the desired behavior for an element's overflow — i.e. when an element's content is too big to...
Read more >
overflow - CSS-Tricks
The overflow property controls what happens to content that breaks outside of its bounds: imagine a div in which you've explicitly set to...
Read more >
CSS Overflow - W3Schools
hidden - The overflow is clipped, and the rest of the content will be invisible; scroll - The overflow is clipped, and a...
Read more >
Finally!!! Override 'Overflow Hidden' in CSS - YouTube
We can override overflow hidden CSS property easily. We can selectively make ... Use transform so that it does not affect the style....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found