Просмотр исходного кода

fix: [treeSelect] auto adjust popover direction after node expand (#720)

YyumeiZhang 3 лет назад
Родитель
Сommit
65271555ce
2 измененных файлов с 4 добавлено и 0 удалено
  1. 1 0
      packages/semi-ui/tree/nodeList.tsx
  2. 3 0
      packages/semi-ui/treeSelect/index.tsx

+ 1 - 0
packages/semi-ui/tree/nodeList.tsx

@@ -55,6 +55,7 @@ export default class NodeList extends PureComponent<NodeListProps, NodeListState
     }
     }
 
 
     onMotionEnd = () => {
     onMotionEnd = () => {
+        typeof this.props.onMotionEnd === 'function' && this.props.onMotionEnd();
         this.setState({ transitionNodes: [] });
         this.setState({ transitionNodes: [] });
     };
     };
 
 

+ 3 - 0
packages/semi-ui/treeSelect/index.tsx

@@ -331,6 +331,9 @@ class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState> {
         this.clickOutsideHandler = null;
         this.clickOutsideHandler = null;
         this.foundation = new TreeSelectFoundation(this.adapter);
         this.foundation = new TreeSelectFoundation(this.adapter);
         this.treeSelectID = Math.random().toString(36).slice(2);
         this.treeSelectID = Math.random().toString(36).slice(2);
+        this.onMotionEnd = () => {
+            this.adapter.rePositionDropdown();
+        };
     }
     }
 
 
     // eslint-disable-next-line max-lines-per-function
     // eslint-disable-next-line max-lines-per-function