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

Table > Responsive: stack is equal scroll, stack not showing #16291

Closed
jorgegarinroman-uv opened this issue Aug 26, 2024 · 9 comments
Closed
Labels
Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior Resolution: Wontfix Issue will not be fixed due to technical limitations

Comments

@jorgegarinroman-uv
Copy link

Describe the bug

On a small screen, table responsive scroll and stack operate the same way: stack responsive is lost.

This error also happens in the primeng guide, in the table > responsive section

Environment

Chrome Versión 128.0.6613.84 (Build oficial) (64 bits)

Reproducer

No response

Angular version

17.3.12

PrimeNG version

17.18.9

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

latest

Browser(s)

Chrome

Steps to reproduce the behavior

No response

Expected behavior

The rows should be displayed as a stack facing down.

@jorgegarinroman-uv jorgegarinroman-uv added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 26, 2024
@andresrestrepo
Copy link

I can see the same, on version 17.18.8 works fine

@noradroid
Copy link

i have the same issue
image

@jorgegarinroman-uv
Copy link
Author

temporal solutions:

  1. Downgrade to version 17.18.8.

or

  1. Apply this CSS
@media screen and (max-width: 992px) {
  .p-datatable-tbody > tr > td > .p-column-title {
    display: block;
  }
  .p-datatable-tbody > tr > td:not(:last-child) {
    border: 0 none;
  }
  .p-datatable-tbody > tr > td {
    display: flex;
    width: 100% !important;
    align-items: center;
    justify-content: space-between;
  }
  .p-datatable-thead > tr > th,
  .p-datatable-tfoot > tr > td {
    display: none !important;
  }
}

@nick-allen
Copy link

nick-allen commented Aug 30, 2024

Looks to be an issue with the dom sanitization, checking the created style when stack is enabled shows this:

<style type="text/css">SafeValue must use [property]=binding: 
    @media screen and (max-width: 960px) {
        #pn_id_2-table > .p-datatable-thead > tr > th,
        #pn_id_2-table > .p-datatable-tfoot > tr > td {
            display: none !important;
        }

        #pn_id_2-table > .p-datatable-tbody > tr > td {
            display: flex;
            width: 100% !important;
            align-items: center;
            justify-content: space-between;
        }

        #pn_id_2-table > .p-datatable-tbody > tr > td:not(:last-child) {
            border: 0 none;
        }

        #pn_id_2.p-datatable-gridlines > .p-datatable-wrapper > .p-datatable-table > .p-datatable-tbody > tr > td:last-child {
            border-top: 0;
            border-right: 0;
            border-left: 0;
        }

        #pn_id_2-table > .p-datatable-tbody > tr > td > .p-column-title {
            display: block;
        }
    }
     (see https://g.co/ng/security#xss)</style>

17.18.8 -> https://github.com/primefaces/primeng/blob/17.18.8/src/app/components/table/table.ts#L3043
17.18.9 -> https://github.com/primefaces/primeng/blob/17.18.9/src/app/components/table/table.ts#L3046

Removing the dom sanitization bypass that was added in 17.18.9 for the style looks to be the fix unless that's needed for this style and just misbehaving for some reason.

@devildant
Copy link

devildant commented Sep 12, 2024

trouble also exist in 17.18.10 :(

@devildant
Copy link

the stack option does not work regardless of the version of primeng with angular 18

@devildant
Copy link

inspired by the previous comment, I have this temporary fix

in html:

<p-table [value]="globalConfig" styleClass="customstack" >
....
</p-table>

in style.css (global):

/*fix bug with primeng and option stack*/
@media screen and (max-width: 992px) {
  .customstack > div > table > .p-datatable-tbody > tr > td > .p-column-title {
    display: block;
  }
  .customstack > div > table > .p-datatable-tbody > tr > td:not(:last-child) {
    border: 0 none;
  }
  .customstack > div > table > .p-datatable-tbody > tr > td {
    display: flex;
    width: 100% !important;
    align-items: center;
    justify-content: space-between;
  }
  .customstack > div > table > .p-datatable-thead > tr > th,
  .customstack > div > table > .p-datatable-tfoot > tr > td {
    display: none !important;
  }
}

@Venom1991
Copy link

I noticed that the whole "Responsive" section for v18's Table page is completely gone. Does this mean that support for this very, very useful feature is gone for good?

@mertsincan mertsincan added Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior Resolution: Wontfix Issue will not be fixed due to technical limitations and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 4, 2024
Copy link

github-actions bot commented Dec 4, 2024

Unfortunately, this issue cannot be fixed due to technical limitations. PrimeNg team has decided not to pursue a fix, as addressing it would introduce other complications. Thanks a lot for your understanding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior Resolution: Wontfix Issue will not be fixed due to technical limitations
Projects
None yet
Development

No branches or pull requests

11 participants
@nick-allen @andresrestrepo @Venom1991 @devildant @mertsincan @jorgegarinroman-uv @noradroid and others