Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug]: AreaChart renders SVG rect with negative width and height on initial render

未关闭 适合新手
#36,976 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@huong8373tt-beep 已经在做这个了。

开始于 2026年10月22日。

  • #36977 来自 @huong8373tt-beep —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
react, typescript

调研方向

从 @fluentui/react-charting 包中的 AreaChart 悬停矩形入手,并使用 StackBlitz 复现来观察它在首次渲染时的尺寸。检查组件中现有的图表渲染测试,并添加对无效初始尺寸的覆盖。当透明的 rect 在测量前不再产生负宽度或负高度时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Needs: Triage :mag: Package: charting Type: Bug :bug:
Charting Control

AreaChart

Package version

@fluentui/react-charting 5.25.6

React version

React 19.2.4

Environment
System:
  OS: Windows 11 Enterprise 10.0.26300
  CPU: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
  Node: v24.11.0
Browsers:
  Edge: 155.0.4283.45
npmPackages:
  @fluentui/react-charting: 5.25.6
  react: 19.2.4
  react-dom: 19.2.4
  @types/react: 18.3.28
  @types/react-dom: 18.3.7
Current Behavior

The browser logs errors about negative SVG rectangle dimensions. The chart displays correctly after measurement, so the visible output is unaffected.

Image
Expected Behavior

Clamp both values to zero, or skip rendering the hover rectangle until the chart has valid dimensions.

Reproduction

https://stackblitz.com/edit/vitejs-vite-gjyhrnvu

Steps to reproduce

Render an AreaChart inside a container with a fixed width and margins.
Open the browser console on first render.
Observe errors about negative width and height on the transparent .

Image
Are you reporting an Accessibility issue?

None

Suggested severity

High - No workaround

Products/sites affected

Content Studio

Are you willing to submit a PR to fix?

yes

Validations
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
主要语言
TypeScript
星标
20.3k
派生
2.9k
平均合并
2 天 10 小时
30 天内合并 PR
72

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/fluentui 的其他 Issue

查看 microsoft/fluentui 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。