-
Notifications
You must be signed in to change notification settings - Fork 678
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: [Descriptions] Ensure that the number of rows matches the column #2201
base: release
Are you sure you want to change the base?
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 13ef2c7:
|
horizontalList.push(curSpan.itemList); | ||
curSpan.itemList = []; | ||
curSpan.totalSpan = 0; | ||
curSpan.totalSpan = item.span || 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个写法感觉有点绕。
建议 18行 totalSpan可以先不执行 + 操作吧。
想做的是尝试在 curSpan放入当前item,那么拿 restSpan剩余列数,跟item.span去做对比会更直观一些。如果 item.span <= restSpan 再做操作,否则就直接另起一行。
如果像现在任意情况下都 先加totalSpan,如果放不下还得还原。
我尝试重新写了一下这段逻辑,感觉是可以不用那么长的。
另外 description 的 item.tsx里也发现了一个上次的PR #2121 review时忽略了的问题,这里为什么要 span *2 -1,似乎应该直接 span || 1也是ok的。 |
上次的PR #2121 span *2-1是因为 align不等于'plain'的时候,要把th的colspan也算进来,这样1column=1th+1td,减1减掉自身的th |
English Template / 英文模板
PR类型 (请至少选择一个)
PR 描述
Fixes #
更新日志
🇨🇳 Chinese
🇺🇸 English
检查清单
其他要求
附加信息