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

DataTable Virtual Scroller: Column Resize Not Working #4102

Closed
mmoss128 opened this issue Feb 27, 2023 · 1 comment
Closed

DataTable Virtual Scroller: Column Resize Not Working #4102

mmoss128 opened this issue Feb 27, 2023 · 1 comment
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@mmoss128
Copy link

Describe the bug

Data table columns are not resizable when utilizing virtual scroller.

Reproducer

https://codesandbox.io/s/primereact-demo-forked-wx492m

PrimeReact version

9.2.0

React version

17.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

  1. Create a data table with virtual scroller
  2. Enable resizable columns with 'resizableColumns'
  3. Attempt to resize columns

Expected behavior

No response

@mmoss128 mmoss128 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 27, 2023
@mmoss128
Copy link
Author

mmoss128 commented Feb 27, 2023

Issue looks to have been introduced with the fix for #4078. This fix introduced a selector modification which includes .p-datatable-wrapper as seen below:

let selector =`.p-datatable[${attributeSelectorState}] > .p-datatable-wrapper > .p-datatable-table`;

This new selector does not account for when virtual scrollers are enabled as a an additional div with class '.p-virtualscroller' is injected. Possible remediation is to add branching if using a virtual scroller in "/components/lib/datatable/DataTable.js" method "resizeTableCells".

    var selector = (".p-datatable[").concat(attributeSelectorState, "] > .p-datatable-wrapper > .p-datatable-table");
  if(!isVirtualScrollerDisabled()){
      selector = (".p-datatable[").concat(attributeSelectorState, "] > .p-datatable-wrapper > .p-virtualscroller > .p-datatable-table");
    }

@mertsincan mertsincan self-assigned this Feb 27, 2023
@mertsincan mertsincan added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 27, 2023
@mertsincan mertsincan added this to the 9.2.1 milestone Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants