Просмотр исходного кода

bye this.typeahead.getInstance()

Shun Miyazawa 4 лет назад
Родитель
Сommit
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) {
   handleSelect(e) {
     if (e.keyCode === 32) { // '32' means ASCII code of 'space'
     if (e.keyCode === 32) { // '32' means ASCII code of 'space'
       e.preventDefault();
       e.preventDefault();
-      const instance = this.typeahead.getInstance();
-      const { initialItem } = instance.state;
+      const { initialItem } = this.tagsInput.state;
 
 
       if (initialItem) {
       if (initialItem) {
-        instance._handleMenuItemSelect(initialItem, e);
+        this.tagsInput._handleMenuItemSelect(initialItem, e);
       }
       }
     }
     }
   }
   }