primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Improve overflow hidden on DataTable

Open sliekens opened this issue 9 years ago • 10 comments

Every DataTable cell hides its overflow by default. Is this really necessary? What kind of content would cause cells to overflow in a bad way?

Same question for the header part of a scrollable table:

.ui-datatable-scrollable-header {
    overflow: hidden;
}

Why would you always want to hide overflow?

I'm asking because I keep running into situations where I need to display controls inside cells that should flow over the cell borders of the DataTable, such as drop-down lists and calendars . The default styling makes this more difficult than it should be.

sliekens avatar Apr 03 '17 14:04 sliekens

This is causing problems when I add dropdown filter to header - it is patially hidden behind data rows image and when I remove "overflow:hidden" image

thenoen avatar Apr 28 '17 15:04 thenoen

I would like to know what problem is solved by hiding overflow. I just don't see it.

sliekens avatar Apr 28 '17 15:04 sliekens

"overflow:hidden" is causing problems (first picture). If I change it to "overflow:visible" the dropdown is visible as expected (second picture). After posting tjhis comment I found another github issue with workaround https://github.com/primefaces/primeng/issues/2368

thenoen avatar Apr 28 '17 15:04 thenoen

So the question remains: why is "overflow:hidden" the default style? It causes many problems and appears to solve none.

sliekens avatar Apr 29 '17 09:04 sliekens

Seems like that style is for everything I need to use. Kind of interesting considering later on in the template you have something like this going on for a ui-dropdown-panel class. z-index: 1001? hmmm....what's going on here? element.style { display: block; visibility: visible; top: 20px; left: 0px; z-index: 1001; opacity: 1; }

RebelSyntax avatar May 05 '17 15:05 RebelSyntax

I'll rethink this for 4.1.0 final, it is only necessary for resizable columns and body of scrollable table, for other cases we can avoid it. Also overlay components have appendTo="body" to avoid this.

cagataycivici avatar Jun 20 '17 20:06 cagataycivici

Pulling components out of their parent node and appending them to the document root is a lazy workaround for something that can be solved with CSS only. I'm not very knowledgeable about accessibility but I can imagine that moving elements around the DOM like that makes web apps unusable to people who rely on screen readers and such.

sliekens avatar Jun 21 '17 08:06 sliekens

We have a need to display a filter dropdown from the header of a table while using resizeble columns and a scrollable table. Hoping this usage can also be handled in the next version.

machfalcon avatar Jun 28 '17 19:06 machfalcon

@StevenLiekens I see that as a nice addon to enhance flexibility, so that you can customize the component. About overflow, we definitely need scrollable body to be auto to get the scrollbar, for scrollheader header and footer, it has to be hidden so that we can avoid display scrollbar for them.

For regular cells, it makes sense for only resizable columns to be overflow hidden, I'll do this change.

cagataycivici avatar Jun 29 '17 08:06 cagataycivici

I upgraded to 4.2.1 and the problem seems to still persist... appendTo="body" is still the only solution that I can tell.

dennisward avatar Oct 01 '17 19:10 dennisward