Sfoglia il codice sorgente

Card Details, Ctrl+Enter at description editing raised an error

Console:
Uncaught TypeError: can't access property "click", this.find(...) is null
Martin Filser 3 anni fa
parent
commit
125c84b6b5
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      client/components/cards/cardDescription.js

+ 4 - 1
client/components/cards/cardDescription.js

@@ -25,7 +25,10 @@ BlazeComponent.extendComponent({
         // Pressing Ctrl+Enter should submit the form
         // Pressing Ctrl+Enter should submit the form
         'keydown form textarea'(evt) {
         'keydown form textarea'(evt) {
           if (evt.keyCode === 13 && (evt.metaKey || evt.ctrlKey)) {
           if (evt.keyCode === 13 && (evt.metaKey || evt.ctrlKey)) {
-            this.find('button[type=submit]').click();
+            const submitButton = this.find('button[type=submit]');
+            if (submitButton) {
+              submitButton.click();
+            }
           }
           }
         },
         },
       },
       },