Parcourir la source

fix: [Input] Call the init function in componentDidmount

zhangyumei.0319 il y a 2 ans
Parent
commit
150f819462
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  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 });