Эх сурвалжийг харах

[notebook] Move focus to the ace editor after switching snippet type

Johan Ahlen 10 жил өмнө
parent
commit
60fe180

+ 5 - 0
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -199,6 +199,11 @@
         self.properties(ko.mapping.fromJS(getDefaultSnippetProperties(newValue)));
       }
       self.result.clear();
+      window.setTimeout(function () {
+        if (self.ace() !== null) {
+          self.ace().focus();
+        }
+      }, 100);
     });
 
     self.variables = ko.observableArray([]);