mui / mui/material-ui

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

Open
#40,327 1 comment 0 reactions 1 assignee View on GitHub

@siriwatknp is already working on this.

Since Dec 26, 2023.

external dependency on hold package: joy-ui scope: list
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the 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 

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.