浏览代码

perf: select content in popover delay to render when popup is visible, #2598

point.halo 10 月之前
父节点
当前提交
785853fc20
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      packages/semi-ui/select/index.tsx

+ 1 - 3
packages/semi-ui/select/index.tsx

@@ -1508,7 +1508,6 @@ class Select extends BaseComponent<SelectProps, SelectState> {
             dropdownMargin,
         } = this.props;
         const { isOpen, optionKey } = this.state;
-        const optionList = this.renderOptions(children);
         const selection = this.renderSelection();
         return (
             <Popover
@@ -1518,10 +1517,9 @@ class Select extends BaseComponent<SelectProps, SelectState> {
                 autoAdjustOverflow={autoAdjustOverflow}
                 mouseLeaveDelay={mouseLeaveDelay}
                 mouseEnterDelay={mouseEnterDelay}
-                // transformFromCenter TODO: check no such property
                 zIndex={zIndex}
                 ref={this.optionsRef}
-                content={optionList}
+                content={() => this.renderOptions(children)}
                 visible={isOpen}
                 trigger="custom"
                 rePosKey={optionKey}