Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: 修复 legend maxItemWidth 计算错误 #1314

Merged
merged 2 commits into from
Dec 16, 2021
Merged

Conversation

El-Chiang
Copy link
Contributor

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Description of change

两个问题:

  • willMount 期间手动触发 render 时拿到的 this.state.items 为空数组,导致计算出来的 width 为 0
  • isVertical = true 时没有 remove 掉用于计算时渲染的 shape

@@ -103,7 +122,8 @@ export default (View) => {
}

getItems() {
return this.state.items;
const { items } = this.state;
return items?.length ? items : (this.getOriginItems() || []);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@zengyue zengyue merged commit 8921949 into v4.0.x Dec 16, 2021
@zengyue zengyue deleted the fix/legend-max-width branch December 16, 2021 03:47
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants