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

Data-table scroll disappears when filtering in a field shown by width scroll #1805

Closed
celopezh opened this issue Jan 12, 2017 · 10 comments
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@celopezh
Copy link

[x ] bug report => When filtering a field in the last columns in a data-table that has width scroll, the data table hide the shown column and I am not able to return to the column to filter again.

Current behavior

  1. I added 10 columns in a data table, not all of them are shown in the html view and the others are visible only when I scroll right the data table.
  2. All columns has a filter activated, and when I filter in with column number 8, and it doesn't match with any of the records, the following error appears:
    ERROR: the scroll disappear and show only the columns that were visible initially ( without scrolling ), and does not permit to see the field I filtered with and clear the content to show my records again.

Expected behavior
To be able to scroll, see and write again in the field after filter in it, when I get a non record results

  • Angular version: 2.1.2

  • PrimeNG version: 1.1.4

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

@myclau
Copy link

myclau commented Feb 17, 2017

same situation.
if the scrollbar can appear when there are no record would be better, and problem solve.

@EddLeGuerrier
Copy link

same situation with primeng@4.0.0 stable

@vermashailesh
Copy link

Hi does anyone got the solution for this.

@goldbergyoni
Copy link

Same bug here

@vermashailesh
Copy link

Got the solution...just fix the width of datatable .

@goldbergyoni
Copy link

@vermashailesh can you kindly elaborate/exemplify? you mean set a CSS style-width attribute over the p-datattable?

@goldbergyoni
Copy link

This patch fixed that for me:
.ui-datatable-scrollable-view
{
overflow:scroll !important
}

.ui-datatable-scrollable-body
{
overflow:visible !important
}

@cagataycivici cagataycivici self-assigned this Jun 19, 2017
@cagataycivici cagataycivici added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Jun 19, 2017
@cagataycivici cagataycivici added this to the 4.1.0 milestone Jun 19, 2017
@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Jun 28, 2017
@umdstu
Copy link

umdstu commented Nov 9, 2018

@cagataycivici Can you elaborate on how your patch fixes this? The above fix from i0natan doesn't work. Setting .ui-table-scrollable-header to overflow:auto instead of overflow:hidden allows you scroll the header when there are no rows, but as soon as you add a row, you now have two horizontal scroll-bars.

@sonalnaik
Copy link

sonalnaik commented Apr 15, 2019

I resolved this using some javascript code.
If user filters and no data found in that case, we can use following code snippet.

var element = document.querySelectorAll('.ui-table-unfrozen-view')
//ui-table-unfrozen-view is dynamically generated class for table body
if(data == false){ //no data present
element[0].classList.add('overFlowClass')
}else{
element[0].classList.remove('overFlowClass')
//its necessary to remove class if data is there, otherwise two scrolls will appear
}

//In css file
.overFlowClass {
overflow: auto !important;
height: 450px;
}

Hope this helps..

@himenp
Copy link

himenp commented Jul 24, 2020

This might fix your issue.

.ui-table-scrollable-wrapper {
overflow: auto !important;
}

.ui-table-scrollable-header, .ui-table-scrollable-body, .ui-table-scrollable-footer {
overflow: visible !important;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

9 participants