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

Component: Table - non-resizable columns are changing width when resizing other columns #13765

Closed
victorsc opened this issue Sep 27, 2023 · 4 comments
Labels
Resolution: Cannot Replicate Issue could not be replicated by Core Team

Comments

@victorsc
Copy link

Describe the bug

Given

<div class="card">
    <p-table [value]="products" stateStorage="local" stateKey="table" [resizableColumns]="true" columnResizeMode="expand" styleClass="p-datatable-gridlines" [tableStyle]="{'min-width': '50rem'}">
        <ng-template pTemplate="header">
            <tr>
                <th pResizableColumn [pResizableColumnDisabled]='true' [style.width]="'100px'">Code</th>
                <th pResizableColumn [pResizableColumnDisabled]='true' [style.width]="'100px'">Name</th>
                <th pResizableColumn>Category</th>
                <th pResizableColumn>Quantity</th>
            </tr>
        </ng-template>
        <ng-template pTemplate="body" let-product>
            <tr>
                <td [style.width]="'100px'">{{product.code}}</td>
                <td [style.width]="'100px'">{{product.name}}</td>
                <td>{{product.category}}</td>
                <td>{{product.quantity}}</td>
            </tr>
        </ng-template>
    </p-table>
</div>

when resizing Category or Quantity columns, Code and Name are getting wider.

The columns are not directly resizable and have a fixed width.

Please find below a reproduction repository for the issue.

May be similar with #12344

Thanks you.

Environment

"primeng": "15.4.1",
"@angular/core": "^15.2.8",

Reproducer

https://github.com/victorsc/primeng-table-col-width

Angular version

15.2.8

PrimeNG version

15.4.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.17.1

Browser(s)

Chrome 116

Steps to reproduce the behavior

  1. resize (expand) the Category or Quantity columns

Actual behaviour: Code and Name columns slightly change widths

Expected behavior

Code and Name columns, which are not resisable, should not change width

@victorsc victorsc added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 27, 2023
@cetincakiroglu
Copy link
Contributor

Could you please remove min-width and try again?

@victorsc
Copy link
Author

victorsc commented Sep 28, 2023

hello @cetincakiroglu
I believe you refer to the inline style [style.width]="'100px'"
Removing it doesn't help. The first 2 columns still get expended when I resize one of the last ones.

Also tried to remove [tableStyle]="{'min-width': '50rem'}" but nothing changed.

@cetincakiroglu
Copy link
Contributor

Hi,

Your issue cannot be reproducible with the latest PrimeNG (16.4.1). See here: https://stackblitz.com/edit/s1j6jl?file=src%2Fapp%2Fdemo%2Ftable-column-resize-expand-mode-demo.html

The issue is probably fixed in a version within 15.4.1-16.4.1, we suggest you use the latest.

I am closing the issue since it does not exist with PrimeNG 16.4.1

@cetincakiroglu cetincakiroglu added Resolution: Cannot Replicate Issue could not be replicated by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 28, 2023
@github-actions
Copy link

We're unable to replicate your issue, if you are able to create a reproducer by using PrimeNG Issue Template or add details please edit this issue. This issue will be closed if no activities in 20 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Cannot Replicate Issue could not be replicated by Core Team
Projects
None yet
Development

No branches or pull requests

2 participants