【发布时间】:2019-10-25 07:20:44
【问题描述】:
我有一个不超过 30 项的清单。但是,当我单击全选然后取消选择或取消选择时,只有一个项目页面会冻结一段时间,然后再次恢复正常并更新选中或未选中的值。我不明白发生了什么。 这是 antd select 本身的问题,或者是因为切换选择/取消选择导致此延迟可能是因为整个列表非常频繁地重新渲染。 另外,在控制台中,我得到了类似的东西,
[Violation] 'setTimeout' handler took 109ms
[Violation] 'click' handler took 206ms
[Violation] Forced reflow while executing JavaScript took 72ms
[Violation] 'click' handler took 204ms
[Violation] 'click' handler took 390ms
[Violation] Forced reflow while executing JavaScript took 180ms
[Violation] 'animationend' handler took 13282ms
[Violation] 'animationend' handler took 13341ms
[Violation] Forced reflow while executing JavaScript took 12864ms
[Violation] 'click' handler took 171ms
ANTD 选择 - https://ant.design/components/select/
提前致谢。
【问题讨论】:
-
可以在你使用antd select的地方加上代码吗?
标签: reactjs select drop-down-menu antd react-select