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

fix: 修复通过修改引用的方式修改菜单配置时, tooltip 未重新渲染 #2933

Merged
merged 3 commits into from
Oct 25, 2024

Conversation

lijinke666
Copy link
Member

👀 PR includes

🐛 Bugfix

  • Solve the issue and close #0

📝 Description

    const operator = {
      menu: {
        items: [
          {
            key: 'menu-a',
            label: <div className="menu-a-text">menu-a-text</div>,
          },
        ],
      },
    };

    await s2.showTooltip({
      position: { x: 0, y: 0 },
      options: {
        operator,
      },
    });

    await sleep(1000);

    // 通过修改引用, 重新赋值的方式, 无法触发组件层的 rerender
    operator.menu!.items = [
      ...operator.menu!.items!,
      {
        key: 'menu-b',
        label: <div className="menu-b-text">menu-b-text</div>,
      },
    ];

    await s2.showTooltip({
      position: { x: 0, y: 0 },
      options: {
        operator,
      },
    });

🖼️ Screenshot

Before After

🔗 Related issue link

🔍 Self-Check before the merge

  • Add or update relevant docs.
  • Add or update relevant demos.
  • Add or update test case.
  • Add or update relevant TypeScript definitions.

Copy link

vercel bot commented Oct 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
antvis-s2 ❌ Failed (Inspect) Oct 25, 2024 7:57am

Copy link
Contributor

github-actions bot commented Oct 22, 2024

Size Change: +1 B (0%)

Total Size: 335 kB

Filename Size Change
./packages/s2-react/dist/index.min.js 70.9 kB +1 B (0%)
ℹ️ View Unchanged
Filename Size
./packages/s2-core/dist/index.min.js 236 kB
./packages/s2-core/dist/style.min.css 388 B
./packages/s2-react/dist/style.min.css 3.77 kB
./packages/s2-vue/dist/index.min.js 22.9 kB
./packages/s2-vue/dist/style.min.css 1.85 kB

compressed-size-action

@wjgogogo wjgogogo merged commit 82c1500 into next Oct 25, 2024
7 of 9 checks passed
@wjgogogo wjgogogo deleted the fix-menu-operator branch October 25, 2024 08:21
@lijinke666
Copy link
Member Author

🎉 This PR is included in version @antv/s2-react-v2.0.0-next.29 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next 2.0-next 版本的问题 pr(fix) bug fix released on @next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants