-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
ListItem doesn't lose focus when mouse out after click #14673
Comments
@xs9627 Thank you for the report, the regression was introduced in #14212. We should be able to fix it by removing the unterlated focus style changes of the pull request, we should have keep it isolated to the key handling: --- a/packages/material-ui/src/ListItem/ListItem.js
+++ b/packages/material-ui/src/ListItem/ListItem.js
@@ -20,7 +20,7 @@ export const styles = theme => ({
textAlign: 'left',
paddingTop: 11, // To use 10px in v4
paddingBottom: 11, // To use 10px in v4
- '&$selected, &$selected:hover, &$selected:focus': {
+ '&$selected, &$selected:hover': {
backgroundColor: theme.palette.action.selected,
},
},
@@ -28,9 +28,10 @@ export const styles = theme => ({
container: {
position: 'relative',
},
- // To remove in v4
/* Styles applied to the `component`'s `focusVisibleClassName` property if `button={true}`. */
- focusVisible: {},
+ focusVisible: {
+ backgroundColor: theme.palette.action.selected,
+ },
/* Legacy styles applied to the root element. Use `root` instead. */
default: {},
/* Styles applied to the `component` element if `dense={true}` or `children` includes `Avatar`. */
@@ -69,9 +70,6 @@ export const styles = theme => ({
backgroundColor: 'transparent',
},
},
- '&:focus': {
- backgroundColor: theme.palette.action.hover,
- },
},
/* Styles applied to the `component` element if `children` includes `ListItemSecondaryAction`. */
secondaryAction: { Do you want to submit a pull request? :) |
It's now only fixed in 4.x.x, shouldn't it be fixed in 3.x.x too, considering it's still broken there? |
@leroydev We would be happy to apply the same bug fix on v3.9. We hope to release the first beta release of v4 this weekend. |
Expected Behavior 🤔
ListItem should lose focus after mouse out.
Current Behavior 😯
Still focused after mouse out
Steps to Reproduce 🕹
Link:
Compare from v3.9.0 to v3.9.2.
https://imgur.com/a/r0jpijj
Context 🔦
Your Environment 🌎
The text was updated successfully, but these errors were encountered: