Преглед на файлове

fix: TagSelect can't clear value when Form run resetFields (#3031)

kenve преди 7 години
родител
ревизия
2f6288b517
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      src/components/TagSelect/index.js

+ 2 - 2
src/components/TagSelect/index.js

@@ -28,8 +28,8 @@ class TagSelect extends Component {
   }
   }
 
 
   static getDerivedStateFromProps(nextProps) {
   static getDerivedStateFromProps(nextProps) {
-    if ('value' in nextProps && nextProps.value) {
-      return { value: nextProps.value };
+    if ('value' in nextProps) {
+      return { value: nextProps.value || [] };
     }
     }
     return null;
     return null;
   }
   }