-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[data grid] GridFilterInputMultipleValue
's prop types are incorrectly typed
#13409
Comments
GridFilterInputMultipleValue
's prop types are incorrectly typed
Hey @karudedios it seems the example you linked is incomplete. Did you mean to provide a custom filtering mechanism for dates, to select multiple values? |
Hi @michelengelen, thanks for noting it- I had copied the link from original sandbox pointed at one of MUI's demos instead of the version I forked/modified. The correct Code Sandbox is https://codesandbox.io/p/sandbox/dark-fire-x498pg, which I've now updated in the description as well.
Yes, I added a custom |
Thanks for that. diff --git a/packages/x-data-grid/src/components/panel/filterPanel/GridFilterInputMultipleValue.tsx b/packages/x-data-grid/src/components/panel/filterPanel/GridFilterInputMultipleValue.tsx
index 0d39447e6..a7f3e805e 100644
--- a/packages/x-data-grid/src/components/panel/filterPanel/GridFilterInputMultipleValue.tsx
+++ b/packages/x-data-grid/src/components/panel/filterPanel/GridFilterInputMultipleValue.tsx
@@ -6,7 +6,7 @@ import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
import { GridFilterInputValueProps } from './GridFilterInputValueProps';
export type GridFilterInputMultipleValueProps = {
- type?: 'text' | 'number';
+ type?: 'text' | 'number' | 'date' | 'datetime-local';
} & GridFilterInputValueProps &
Omit<AutocompleteProps<string, true, false, true>, 'options' | 'renderInput'>;
@@ -113,7 +113,6 @@ GridFilterInputMultipleValue.propTypes = {
operator: PropTypes.string.isRequired,
value: PropTypes.any,
}).isRequired,
- type: PropTypes.oneOf(['number', 'text']),
} as any;
export { GridFilterInputMultipleValue }; objections @mui/xgrid ? |
Hi @michelengelen, just wanted to ping on this and check if the PR I submitted for this looks OK and/or if it could get a reviewer assigned, it's linked to this issue but I'm also happy to re-post it for easier visibility #13411. Thanks for your time, and no rush- it's a pretty small issue, albeit a little noisy. |
@karudedios: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Steps to reproduce
Link to live example: (required)
https://codesandbox.io/p/sandbox/dark-fire-x498pg?file=%2Fsrc%2FDemo.tsx
Steps:
Created On
to filter bydate
not being supported while input works perfectly with atype = "date"
Current behavior
GridFilterInputMultipleValue
's prop types validation produces noisy error logs when atype
that isn't"text" | "number"
is supported for the underlying input, while in truth any valid HTML input type is supported out of the box.Expected behavior
Just like
GridFilterInputValue
does,GridFilterInputMultipleValue
should expose all supported type values, not just"text "| "number"
Context
I'm trying not to have noisy errors (oftentimes reported to 3rd party telemetry) for using a component's feature that is actually supported and works out of the box just because its prop types definition is unaware of it.
Your environment
npx @mui/envinfo
Search keywords: GridFilterInputMultipleValue, GridFilterInputValue, unsupported, type, date
The text was updated successfully, but these errors were encountered: