浏览代码

fix: [Input] Call the init function in componentDidmount

zhangyumei.0319 2 年之前
父节点
当前提交
150f819462
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      packages/semi-ui/input/index.tsx

+ 1 - 0
packages/semi-ui/input/index.tsx

@@ -219,6 +219,7 @@ class Input extends BaseComponent<InputProps, InputState> {
     componentDidMount(): void {
         // autofocus is changed from the original support of input to the support of manually calling the focus method,
         // so that preventScroll can still take effect under the setting of autofocus
+        this.foundation.init();
         const { disabled, autofocus, preventScroll } = this.props;
         if (!disabled && autofocus) {
             this.inputRef.current.focus({ preventScroll });