Răsfoiți Sursa

bye this.typeahead.getInstance()

Shun Miyazawa 4 ani în urmă
părinte
comite
f94f53e731
1 a modificat fișierele cu 2 adăugiri și 3 ștergeri
  1. 2 3
      packages/app/src/components/Page/TagsInput.jsx

+ 2 - 3
packages/app/src/components/Page/TagsInput.jsx

@@ -57,11 +57,10 @@ class TagsInput extends React.Component {
   handleSelect(e) {
     if (e.keyCode === 32) { // '32' means ASCII code of 'space'
       e.preventDefault();
-      const instance = this.typeahead.getInstance();
-      const { initialItem } = instance.state;
+      const { initialItem } = this.tagsInput.state;
 
       if (initialItem) {
-        instance._handleMenuItemSelect(initialItem, e);
+        this.tagsInput._handleMenuItemSelect(initialItem, e);
       }
     }
   }