-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[List] extract button from ListItem to ListItemButton #26446
Conversation
Details of bundle changes (experimental) @material-ui/core: parsed: +0.10% , gzip: +0.09% |
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
…at/list-item-improvement
packages/material-ui/src/ListItemButton/listItemButtonClasses.ts
Outdated
Show resolved
Hide resolved
@@ -33,25 +33,25 @@ export default function CheckboxList() { | |||
<ListItem | |||
key={value} | |||
role={undefined} |
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.
Its correct place is on the ListItemButton
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
@@ -304,12 +333,14 @@ ListItem.propTypes /* remove-proptypes */ = { | |||
* If `true`, the list item is focused during the first mount. | |||
* Focus will also be triggered if the value changes from false to true. | |||
* @default false | |||
* @deprecated will be removed in v6, checkout `ListItemButton` instead |
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.
Let's not mention any timeline for planned removals. They just become confusing if something changes and don't provide any value now. Mentioning the alternative should be enough.
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.
There is no visual feedback in https://deploy-preview-26446--material-ui.netlify.app/api/list-item/#props that it's deprecated.
Should we have a deprecatedPropType()
as we make them deprecated in TypeScript?
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.
Good point.
For documentation we would need to use We can do deprecation in a separate release though. |
Looking at the first demo in https://deploy-preview-26446--material-ui.netlify.app/components/lists/#simple-list, it looks like we are not following the canonical DOM structure:
Should we update the demo? |
Sure, will create a PR. |
For context, I found this working on #26711. It took me a while to find the List example I could copy with the new DOM structure. |
the main changes are
ListItem.js
andListItemButton.js
, the rests are demos update.ListItem
secondaryAction
prop to stop checking childrendisablePadding
prop (similar toList
) to use withListItemButton
button
related propsListItemButton
dense
,alignItems
,divider
anddisableGutters
docs
ListItemButton
closes #13597
closes #26442
closes #26469
closes #14971 (deprecate
button
prop)Preview: https://deploy-preview-26446--material-ui.netlify.app/components/lists/