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

Fix parsed date/date-time filter resets component #7551

Merged
merged 2 commits into from Apr 15, 2022

Conversation

WiXSL
Copy link
Contributor

@WiXSL WiXSL commented Apr 14, 2022

Fixes #7540

The problem is in the getFilterFormValues return value, if a field is a Date, and has a parse function that returns a date (this is why it happens by default in DateTimeInputs and not in DateInputs), its value gets treated like a regular object, and ends up returning an empty object for that field, instead of the string representation of the date

@@ -237,9 +237,15 @@ const getInputValue = (
key: string,
filterValues: Record<string, any>
) => {
if (formValues[key] === undefined || formValues[key] === null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You get null when a DateInput/DateTimeInput clear button is click by the user

@WiXSL WiXSL added this to the 4.0.1 milestone Apr 14, 2022
@WiXSL WiXSL added the RFR Ready For Review label Apr 14, 2022
@fzaninotto fzaninotto merged commit 03be8ea into master Apr 15, 2022
@fzaninotto fzaninotto deleted the fix-date-parsed-in-filter branch April 15, 2022 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DateTimeInputs not working correctly as Filters
2 participants