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: 10.8.2 Next.JS, Column Filters, DragSelect w/ Multiple Selection Mode making unexpected/incorrect selections #7192

Open
SolidAnonDev opened this issue Sep 16, 2024 · 0 comments
Labels
Component: NextJS NextJS related issue Type: Bug Issue contains a defect related to a specific component.

Comments

@SolidAnonDev
Copy link

SolidAnonDev commented Sep 16, 2024

Describe the bug

When using Next.JS and DataTable, if you set the datatable up with multiple row selection enabled and column filters, the selection is not reliable/selects the incorrect records when a column filter is active. The selection appears to behave normally otherwise.

Reproducer

https://stackblitz.com/edit/stackblitz-starters-d96cc6?file=app%2Ftest-table.tsx

System Information

"dependencies": {
    "@types/node": "^22.5.5",
    "@types/react": "^18.3.6",
    "@types/react-dom": "^18.3.0",
    "autoprefixer": "^10.4.20",
    "eslint": "^8.57.0",
    "eslint-config-next": "^14.2.11",
    "next": "^14.2.11",
    "postcss": "^8.4.47",
    "primereact": "^10.8.2",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "tailwindcss": "^3.4.11",
    "typescript": "5.2.2"
  }

Steps to reproduce the behavior

  1. Test the drag selection without a filter - it will work normally
  2. Add a column filter, for example, filter the name field to -3 so you only see users like user-3 or user-31
  3. Drag over the rows in the datatable with this filter enabled, you will see it is incapable of selecting the visible rows, but appears to select something else that is not visible, though the diagnostic of this is pretty difficult
  4. If you want, you can console.log the selection as it changes and you will see unexpected rows being selected
  5. I also found that the same happens with metakey like using shift to click one record and select a range

Expected behavior

A column filter is able to be active, and the user should be able to select what is visible on screen.

@SolidAnonDev SolidAnonDev 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 16, 2024
@SolidAnonDev SolidAnonDev changed the title DataTable: Next.JS, Column Filters, DragSelect w/ Multiple Selection Mode making unexpected/incorrect selections DataTable: 10.8.2 Next.JS, Column Filters, DragSelect w/ Multiple Selection Mode making unexpected/incorrect selections Sep 17, 2024
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. Component: NextJS NextJS related issue 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 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: NextJS NextJS related issue Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants