Browse Source

use tracker afterFlush to set focus

tod31 4 years ago
parent
commit
31eb9b26b4
1 changed files with 6 additions and 1 deletions
  1. 6 1
      client/components/cards/cardCustomFields.js

+ 6 - 1
client/components/cards/cardCustomFields.js

@@ -287,7 +287,12 @@ CardCustomField.register('cardCustomField');
                 let items = this.getItems();
                 items.splice(idx + 1, 0, '');
                 this.stringtemplateItems.set(items);
-                //event.target.nextSibling.focus();
+
+                Tracker.afterFlush(() => {
+                  const element = this.findAll('input')[idx + 1];
+                  element.focus();
+                  element.value = '';
+                });
               }
             }
           }