mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.89k stars 32.26k forks source link

[joy-ui][List Item Button] The `select` prop renders differently on different browsers and viewports #40327

Open samislam opened 10 months ago

samislam commented 10 months ago

Duplicates

Latest version

Steps to reproduce 🕹

Link to live example: https://mui.com/joy-ui/getting-started/templates/order-dashboard/

Steps:

<ListItemButton  selected>
  {item?.icon}
  <ListItemContent>
    <Typography level="title-sm">{item.label}</Typography>
  </ListItemContent>
</ListItemButton>

image

image

Current behavior 😯

When I focus on the window of the browser, it removes the selection,

When I remove my focus on the browser window, it returns the selection.

Also, when I minimize the window size, it returns the selection, and when I maximize it, it removes the selection.

The behaviur is different in Firefox, Google chrome and Brave browser.

It's causing unexpected behaviours, as I have tried it on 3 different computers. it turned out the there must be some sort of a bug.

Expected behavior 🤔

The selection should be visible when the select prop is provided regardless of the platform, and the situation.

Context 🔦

I tried it on 3 different browsers, they cause different behaviors always, and I also tried it on different view ports.

and I have noticed something, when you enable darkmode, the selection will be visible, the problem is only in the light mode.

Your environment 🌎

npx @mui/envinfo ``` System: OS: Linux 5.15 Linux Mint 21.2 (Victoria) Binaries: Node: 21.4.0 - ~/.nvm/versions/node/v21.4.0/bin/node Yarn: Not Found npm: 10.2.4 - ~/.nvm/versions/node/v21.4.0/bin/npm Browsers: Chrome: 120.0.6099.129 npmPackages: @emotion/react: ^11.11.3 => 11.11.3 @emotion/styled: ^11.11.0 => 11.11.0 @mui/base: 5.0.0-beta.24 @mui/core-downloads-tracker: 5.15.2 @mui/icons-material: ^5.14.18 => 5.14.18 @mui/joy: ^5.0.0-beta.15 => 5.0.0-beta.15 @mui/material: ^5.15.2 => 5.15.2 @mui/private-theming: 5.15.2 @mui/styled-engine: 5.15.2 @mui/system: 5.15.2 @mui/types: 7.2.11 @mui/utils: 5.15.2 @mui/x-date-pickers: ^6.18.6 => 6.18.6 @types/react: ^18 => 18.2.39 react: ^18 => 18.2.0 react-dom: ^18 => 18.2.0 typescript: ^5 => 5.3.2 ```
siriwatknp commented 10 months ago

I don't think this issue is related to us since we are using plain CSS to style the selected state so I mark this as external dependency.