-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
migrate deprecated <ListItemSecondaryAction />
#11033
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
base: master
Are you sure you want to change the base?
Conversation
smeng9
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.
remove unused import
djhi
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.
Thanks!
slax57
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.
Otherwise I prefer this version. Thanks for taking my feedback into account!
| <StyledListItem | ||
| disablePadding | ||
| secondaryAction={ | ||
| isSelected ? ( | ||
| <IconButton | ||
| size="small" | ||
| onClick={event => { | ||
| event.stopPropagation(); | ||
| handleClick(); | ||
| }} | ||
| > | ||
| <CancelIcon /> | ||
| </IconButton> | ||
| ) : null | ||
| } | ||
| {...rest} | ||
| > |
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 causes a minor visual difference:
BEFORE
AFTER
Story: http://localhost:9010/?path=/story/ra-ui-materialui-list-filter-filterlist--basic
| <StyledListItem | ||
| className={className} | ||
| sx={sx} | ||
| disablePadding | ||
| secondaryAction={ | ||
| isSelected ? ( | ||
| <IconButton size="small" onClick={toggleFilter}> | ||
| <CancelIcon /> | ||
| </IconButton> | ||
| ) : null | ||
| } | ||
| > |
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.
Same here. This is more visible here because it creates a misalignment with the button to remove the save query:
BEFORE
AFTER
Story: http://localhost:9010/?path=/story/ra-ui-materialui-list-filter-savedquerieslist--basic
MUI deprecates ListItemSecondaryAction component https://mui.com/material-ui/migration/migrating-from-deprecated-apis/ since v6
secondaryAction as a prop is still supported in MUI v5 through v7 https://v5.mui.com/material-ui/api/list-item/#list-item-prop-secondaryAction
Additional Checks
masterfor a bugfix or a documentation fix, ornextfor a feature