mui / mui/material-ui

[Accordion][material-ui] Selecting all text in one Accordion will unexpectedly select text in other Accordions

Open
#39,613 4 comments 0 reactions 1 assignee View on GitHub

@siriwatknp is already working on this.

Since Nov 20, 2023.

scope: accordion type: bug
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/material-ui/react-accordion/

Steps:

  1. expand the first item
  2. double click all the text in the expanded first item to select all the text, not just one word
  3. expand the second item which should still be collapsed,
  4. all the text in the second item has become selected
Current behavior 😯

When you select all the text in one of the AccordionDetails, all the text in subsequent unexpanded AccordionDetails are also selected

Expected behavior 🤔

selecting text in a accordion item should not impact any other item

Context 🔦

we are using mui/accordion, showing all items, double click one of them to highlight of all.

Your environment 🌎
npx @mui/envinfo
System:
    OS: macOS 14.0
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
  Browsers:
    Chrome: 118.0.5993.117
    Edge: 118.0.2088.69
    Safari: 17.0
  npmPackages:
    @emotion/react: ~11.9.0 => 11.9.0
    @emotion/styled: ~11.8.1 => 11.8.1
    @mui/material: ~5.11.12 => 5.11.12
    @mui/x-date-pickers: 5.0.0-alpha.6 => 5.0.0-alpha.6
    @types/react: 18.2.12 => 18.2.12
    react: 18.2.0 => 18.2.0
    react-dom: 18.2.0 => 18.2.0
    typescript: 4.6.4 => 4.6.4

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.