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] Should warn when 2 items have the same ID #10230

Closed
2 tasks done
ansaganie opened this issue Apr 7, 2023 · 1 comment · Fixed by #11715
Closed
2 tasks done

[TreeView] Should warn when 2 items have the same ID #10230

ansaganie opened this issue Apr 7, 2023 · 1 comment · Fixed by #11715
Assignees
Labels
component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature

Comments

@ansaganie
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example:

Steps:

  1. Create TreeItem with same ids
  2. Try to expand

Current behavior 😯

When parent and child TreeItem has same ids for some user error, and tries to expand children sometimes it freezes sometimes it just do not expand

Expected behavior 🤔

Make it crash if there is an id clash between parents and children

Context 🔦

My app constructs tree objects from the data coming from the API. Because of error on backend side, frontend started to receive list of objects with the same ids. So, when User expanding list of objects Tab freezes. It was really hard to find out why it freezes, as I was pretty sure that ids are unique.

Your environment 🌎

npx @mui/envinfo
Microsoft Edge
Version 111.0.1661.62 (Official build) (64-bit)

  System:
    OS: Windows 10 10.0.19045
  Binaries:
    Node: 18.15.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 9.5.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.19041.1266.0), Chromium (111.0.1661.62)
  npmPackages:
    @emotion/react: ^11.10.4 => 11.10.4
    @emotion/styled: ^11.10.4 => 11.10.4
    @mui/base:  5.0.0-alpha.124
    @mui/core-downloads-tracker:  5.11.16
    @mui/icons-material: ^5.5.0 => 5.8.4
    @mui/lab: ^5.0.0-alpha.97 => 5.0.0-alpha.125
    @mui/material: ^5.10.8 => 5.11.16
    @mui/private-theming:  5.11.13
    @mui/styled-engine:  5.11.16
    @mui/styles: ^5.5.0 => 5.8.4
    @mui/system:  5.11.16
    @mui/types:  7.2.3
    @mui/utils:  5.11.13
    @mui/x-data-grid: ^5.7.0 => 5.12.3
    @mui/x-data-grid-generator: ^5.7.0 => 5.12.3
    @mui/x-data-grid-premium:  5.12.3
    @mui/x-data-grid-pro:  5.12.3
    @mui/x-date-pickers: ^5.0.0-alpha.2 => 5.0.0-alpha.7
    @mui/x-license-pro:  5.12.3
    @types/react: 17.0.43 => 17.0.43
    react: ^18.2.0 => 18.2.0
    react-dom: ^18.2.0 => 18.2.0
    typescript: 4.8.4 => 4.8.4
@ansaganie ansaganie added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 7, 2023
@zannager zannager added package: lab Specific to @mui/lab component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! labels Apr 10, 2023
@siriwatknp siriwatknp added enhancement This is not a bug, nor a new feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 14, 2023
@siriwatknp
Copy link
Member

We could show the warning in the dev environment.

@flaviendelangle flaviendelangle changed the title @mui/lab TreeVeiw TreeItem @mui/lab TreeView TreeItem Sep 5, 2023
@flaviendelangle flaviendelangle transferred this issue from mui/material-ui Sep 5, 2023
@flaviendelangle flaviendelangle changed the title @mui/lab TreeView TreeItem [TreeView] TreeItem Sep 5, 2023
@flaviendelangle flaviendelangle removed the package: lab Specific to @mui/lab label Sep 5, 2023
@flaviendelangle flaviendelangle changed the title [TreeView] TreeItem [TreeView] Should warn when 2 items have the same ID Sep 5, 2023
@flaviendelangle flaviendelangle self-assigned this Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants