Material-ui: background-color of selected item is not changed at right timing when using Select with multiple

Created on 22 Sep 2018  路  1Comment  路  Source: mui-org/material-ui

  • [x] This is not a v0.x issue.
  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

  • I think Select with multiple and button should change the background color when an item is selected.

Current Behavior

  • in mobile(width: xs), selected item is not changed immediately when selected. (now changed when next one is selected)

Steps to Reproduce


Link: https://material-ui.com/demos/selects/#multiple-select
Please see this using developer's tool with mobile mode.

Context

Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | v3.1.0 |
| React | v16.4.1 |
| Browser | Google Chrome 69 |

bug 馃悰 good first issue

Most helpful comment

@ryusaka Thank you for reporting the issue! It's a regression introduced by #12602. The following diff fixes the problem.

    textAlign: 'left',
    paddingTop: 12,
    paddingBottom: 12,
-   '&$selected': {
+   '&$selected, &$selected:hover': {
      backgroundColor: theme.palette.action.selected,
    },
  },

https://github.com/mui-org/material-ui/blob/2802a1c9c39343e21f6e372c0cf255bc3b82b2f2/packages/material-ui/src/ListItem/ListItem.js#L18-L24

Do you want to work on it :)?

>All comments

@ryusaka Thank you for reporting the issue! It's a regression introduced by #12602. The following diff fixes the problem.

    textAlign: 'left',
    paddingTop: 12,
    paddingBottom: 12,
-   '&$selected': {
+   '&$selected, &$selected:hover': {
      backgroundColor: theme.palette.action.selected,
    },
  },

https://github.com/mui-org/material-ui/blob/2802a1c9c39343e21f6e372c0cf255bc3b82b2f2/packages/material-ui/src/ListItem/ListItem.js#L18-L24

Do you want to work on it :)?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mattmiddlesworth picture mattmiddlesworth  路  3Comments

pola88 picture pola88  路  3Comments

rbozan picture rbozan  路  3Comments

newoga picture newoga  路  3Comments

reflog picture reflog  路  3Comments