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

[BUG] <Nav 组件 itemKey 属性为 number 类型时无法展开> #2316

Open
1 task done
ChenBonBon opened this issue Jun 21, 2024 · 0 comments
Open
1 task done

[BUG] <Nav 组件 itemKey 属性为 number 类型时无法展开> #2316

ChenBonBon opened this issue Jun 21, 2024 · 0 comments
Labels
bug Something isn't working document Improvements or additions to documentation good first issue Good for newcomers PR Welcome Welcome pull request :)

Comments

@ChenBonBon
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Which Component

Navigation

Semi Version

2.60.1

Current Behavior

items={[
    { itemKey: 0, text: '用户管理', icon: <IconAvatar /> },
    { itemKey: 1, text: '活动管理', icon: <IconDescriptions /> },
    {
        text: '任务平台',
        icon: <IconTree />,
        itemKey: 2,
        items: ['任务管理', '用户任务查询'],
    },
]}

点击任务平台,导航不会展开,React DevTools 中 openedKeys[2],数据正常,渲染不正常,更换 itemKey 为数字字符串后渲染正常

Expected Behavior

itemKey 为数字或字符串时,点击任务平台,导航正常展开,React DevTools 中 openedKeys[2],数据正常,渲染正常。

Steps To Reproduce

访问 Navigation,在基本使用的代码框中,修改 items 对象中的 itemKey 属性为数字即可复现。

ReproducibleCode

No response

Environment

- OS: macOS 14.5
- browser: Chrome 125.0.6422.142

Anything else?

No response

@pointhalo pointhalo added bug Something isn't working document Improvements or additions to documentation good first issue Good for newcomers PR Welcome Welcome pull request :) labels Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working document Improvements or additions to documentation good first issue Good for newcomers PR Welcome Welcome pull request :)
Projects
None yet
Development

No branches or pull requests

2 participants