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: Global search won't reset when the field is empty on react 17 #3819

Closed
alefduarte opened this issue Dec 23, 2022 · 0 comments · Fixed by #3820
Closed

DataTable: Global search won't reset when the field is empty on react 17 #3819

alefduarte opened this issue Dec 23, 2022 · 0 comments · Fixed by #3820
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@alefduarte
Copy link

Describe the bug

When using the globalFilter parameter of the DataTable, it won't reset the searched items when clearing the search input. Let's say you have 100 items and search for the letter 'a', now you have 20 items, if you clear the input or erase the word, you still have 20 items, it won't reset when the input is empty.
You can see this behavior in the examples: https://www.primefaces.org/primereact/datatable/crud.
You start out with 30 items, if you search for the letter 'z' you will have 4 items, if you erase it, you still have 4 items.

Reproducer

https://codesandbox.io/s/soyt1t

PrimeReact version

8.0.0

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

Chrome

Steps to reproduce the behavior

  1. Search for any word on the search input.
  2. Clear the input.
  3. The items won't reset.

Expected behavior

When clearing the input, all the existing items should be displayed.

@alefduarte alefduarte added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 23, 2022
melloware added a commit to melloware/primereact that referenced this issue Dec 24, 2022
@melloware melloware self-assigned this Dec 24, 2022
@melloware melloware 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 Dec 24, 2022
@melloware melloware added this to the 8.7.4 milestone Dec 24, 2022
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

Successfully merging a pull request may close this issue.

2 participants