primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Turbo Table: Shows scrollbars on Edge and IE11 even though [scrollable] is disabled

Open eliadeini opened this issue 8 years ago • 4 comments

I'm submitting:

[X] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Hi, I used Turbo-Table with resizable columns and with [scrollable] property set to false and my table was created with unnecessary vertical and horizontal scrollbars on Microsoft Edge and Internet Explorer browsers (Chrome and FireFox handled that correctly)

  1. Environment
  • PrimeFaces version: 5.2.4
  • Also occurs on last version (6-Alpha)
  • Application server + version:
  • Affected browsers: Microsoft Edge 42.17134.1.0, Microsoft IE11.0.65 (Works well on Chrome and FireFox)
  1. Expected behavior Table should appear without scrollbars.

  2. Actual behavior Table should render without scrollbars.

  3. Steps to reproduce Build a simple text data table, with about 10 rows, with resizeable columns and [scrollable]="false"

Code is below: (The /src folder of the project is zipped) app.component.html

<p-table [value]="cars" [resizableColumns]="true" [scrollable]="false">
  <ng-template pTemplate="header">
    <tr>
      <th *ngFor="let col of cols" pResizableColumn>
        {{col.header}}
      </th>
    </tr>
  </ng-template>
  <ng-template pTemplate="body" let-car>
    <tr>
      <td *ngFor="let col of cols" class="ui-resizable-column">
        {{car[col.field]}}
      </td>
    </tr>
  </ng-template>
</p-table>

app.component.ts

import {Component, OnInit} from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styles: []
})
export class AppComponent implements OnInit {

  constructor() {
  }

  cars: any[];

  cols: any[];

  ngOnInit() {
    this.cars = [
      {vin: '11', year: '1111', brand: 'dddd', color: 'blue', madeIn: 'Japan'},
      {vin: '12', year: '1112', brand: 'aaaa', color: 'green', madeIn: 'Germany'},
      {vin: '13', year: '1113', brand: 'cccc', color: 'yellow', madeIn: 'Japan'},
      {vin: '14', year: '1114', brand: 'dddd', color: 'blue', madeIn: 'Japan'},
      {vin: '15', year: '1115', brand: 'aaaa', color: 'green', madeIn: 'Korea'},
      {vin: '16', year: '1116', brand: 'cccc', color: 'black', madeIn: 'China'},
      {vin: '17', year: '1117', brand: 'dddd', color: 'blue', madeIn: 'USA'},
      {vin: '18', year: '1118', brand: 'aaaa', color: 'green', madeIn: 'Japan'},
      {vin: '19', year: '1119', brand: 'cccc', color: 'grey', madeIn: 'Germany'},
      {vin: '20', year: '1120', brand: 'dddd', color: 'blue', madeIn: 'France'},
    ];

    this.cols = [
      {field: 'vin', header: 'Vin'},
      {field: 'year', header: 'Year'},
      {field: 'brand', header: 'Brand'},
      {field: 'color', header: 'Color'},
      {field: 'madeIn', header: 'Made In'}
    ];
  }
}

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';


import {TableModule} from 'primeng/table';
import {AppComponent} from './app.component';


@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    TableModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }


src.zip

eliadeini avatar May 31 '18 13:05 eliadeini

Any updates on this issue? I'm experiencing the same thing just after upgrading from datatable to turbotable.

waustinlynn avatar Aug 10 '18 18:08 waustinlynn

I see the same issue. It appears that there is an issue with how IE 11 and Edge is calculating heights and the use of .ui-table-auto-layout > .ui-table-wrapper { overflow-x: auto; } Removing that css seems to fix the issue, but likely will cause issues if someone was to turn on scrolling.

markleppke avatar Aug 29 '18 16:08 markleppke

I succeeded to bypass this issue somehow by using flex:

.my-table,
.my-table .ui-table,
.my-table .ui-table-scrollable-wrapper,
.my-table .ui-table-scrollable-view,
.my-table .ui-table-scrollable-body
{
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 0;
}

.my-table {
  ui-table-scrollable-body {
    overflow-y: auto;
  }
}

I kept the [scrollable]="true" parameter of the p-table.

The behavior I wanted was that the table's body will grow as possible according to the page size with a vertical scrollbar if necessary. I think that what solved the problem.

BTW: Write the flex definitions as I did it, Edge and Explorer doesn't understand the shortcut flex: 1 1 0

eliadeini avatar Aug 30 '18 05:08 eliadeini

This issue is not fixed in v 8.0.3

pantonis avatar Oct 04 '19 12:10 pantonis