Is there a reason ListItemSecondaryAction is absolutley positioned?
See original GitHub issue- This is not a v0.x issue.
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
I just run into #8205 for the nth time and my fix is always the same, make ListItemSecondaryAction staticly positioned, make the list item container a flexbox and undo the additional padding.
<ListItem
style={{paddingRight: 16}}
ContainerProps={{
style: {display: 'flex', alignItems: 'center'},
}}
>
...
<ListItemSecondaryAction
style={{position: 'static', transform: 'none'}}
>
...
</ListItemSecondaryAction>
</ListItem>
It would be nice if this was not necessary and instead the default behavior.
Current Behavior
The ListItemSecondaryAction is absolutely positioned, causing the problem that it does not grow to take the space needed for its content.
Examples
N/A
Context
I think this is described with enough context above.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Is there a reason ListItemSecondaryAction is absolutley ...
The ListItemSecondaryAction is absolutely positioned, causing the problem that it does not grow to take the space needed for its content.
Read more >Have two secondary action elements in a list - Stack Overflow
Here are the styles for the secondary action from ListItem: ... to avoid collision as `ListItemSecondaryAction` // is absolutely positioned.
Read more >[Solved]-Have two secondary action elements in a list-Reactjs
Here are the styles for the secondary action from ListItem: ... Add some space to avoid collision as `ListItemSecondaryAction` // is absolutely positioned....
Read more >ListItemSecondaryAction API - Material UI - MUI
API reference docs for the React ListItemSecondaryAction component. Learn about the props, CSS, and other APIs of this exported module.
Read more >Is it also a living hell for you dealing with position absolute?
Position absolute is not tech debt wtf are you goin on about. When an element needs to be absolutely positioned relative to another...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I tried this long ago and we merged https://github.com/mui-org/material-ui/pull/5911 but reverted due to the ripple issue.
I did try to revisit this, I still have the branch https://github.com/alienfast/material-ui/tree/list-item-flex-revisited - I tried with a ripple bounding element but I did not have success.
I just bumped into this again - am using a ListItem without
button
but with secondary actions, and want the content to grow but not overflow the actions. I’ll do something custom for now but I definitely think revisiting this is worthwhile.Use a scary method to patch it