-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[data grid] Improve types in GridEditSingleSelect #18184
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] Improve types in GridEditSingleSelect #18184
Conversation
|
Thanks for adding a type label to the PR! 👍 |
|
Deploy preview: https://deploy-preview-18184--material-ui-x.netlify.app/ Bundle size report
|
| function isKeyboardEvent(event: any): event is React.KeyboardEvent { | ||
| return !!event.key; | ||
| function isKeyboardEvent(event: React.SyntheticEvent): event is React.KeyboardEvent { | ||
| return 'key' in event && !!event.key; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change requires to add run-time logic to remove any, If additional run-time is not required to remove any here, i can revert this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change seems fine to me. 👍🏼
|
This pull request has been inactive for 30 days. Please remove the stale label or leave a comment to keep it open. Otherwise, it will be closed in 15 days. |
michelengelen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| function isKeyboardEvent(event: any): event is React.KeyboardEvent { | ||
| return !!event.key; | ||
| function isKeyboardEvent(event: React.SyntheticEvent): event is React.KeyboardEvent { | ||
| return 'key' in event && !!event.key; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change seems fine to me. 👍🏼
This pull request refines type safety and improves code clarity in the
GridEditSingleSelectCellcomponent within thepackages/x-data-gridpackage. The changes focus on enhancing type definitions and simplifying event handling.