Преглед изворни кода

bye this.typeahead.getInstance()

Shun Miyazawa пре 4 година
родитељ
комит
f94f53e731
1 измењених фајлова са 2 додато и 3 уклоњено
  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);
       }
     }
   }