Skip to content
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

[TreeView] no selected background color applied on mobile device #20311

Closed
2 tasks done
tonyhallett opened this issue Mar 28, 2020 · 3 comments · Fixed by #21514
Closed
2 tasks done

[TreeView] no selected background color applied on mobile device #20311

tonyhallett opened this issue Mar 28, 2020 · 3 comments · Fixed by #21514
Labels
bug 🐛 Something doesn't work component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module!

Comments

@tonyhallett
Copy link
Contributor

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

There is no selected background color for a selected tree item.

Expected Behavior 🤔

There is selected background color for a selected tree item.

Steps to Reproduce 🕹

https://codesandbox.io/s/wizardly-maxwell-e7mmk

Steps:

  1. Select item

https://github.com/mui-org/material-ui/blob/81c20b849f7aeddb4004ed215d80f7ca609354c1/packages/material-ui-lab/src/TreeItem/TreeItem.js#L32

export const styles = (theme) => ({
  /* Styles applied to the root element. */
  root: {
    listStyle: 'none',
    margin: 0,
    padding: 0,
    outline: 0,
    WebkitTapHighlightColor: 'transparent',
    '&:focus > $content $label': {
      backgroundColor: theme.palette.action.hover,
    },
    '&$selected > $content $label': {
      backgroundColor: fade(theme.palette.primary.main, theme.palette.action.selectedOpacity),
    },
    '&$selected > $content $label:hover, &$selected:focus > $content $label': {
      backgroundColor: fade(
        theme.palette.primary.main,
        theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity,
      ),
      // Reset on touch devices, it doesn't add specificity
      '@media (hover: none)': {
        backgroundColor: 'transparent',//******************************************
      },
    },
  },
@oliviertassinari oliviertassinari added the component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! label Mar 29, 2020
@merterden98
Copy link

I just did a little investigating, and was wondering what the point of the media query was here. Removing it seems to restore your expected functionality, perhaps @oliviertassinari or @joshwooding could elaborate on this more.

@joshwooding
Copy link
Member

Nice spot. Didn't notice it then but this was fixed in #21514

@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Jun 28, 2020
@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 28, 2020

@joshwooding Awesome, it sounds like we should be able to roll out the approach of Pagination and TreeView to the other components, DatePicker's included :). I have opened an issue so we don't forget mui/material-ui-pickers#1943.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants