vendor/assets/javascripts/codemirror/addons/dialog/dialog.js in codemirror-rails-5.11.1 vs vendor/assets/javascripts/codemirror/addons/dialog/dialog.js in codemirror-rails-5.12
- old
+ new
@@ -54,10 +54,12 @@
}
}
var inp = dialog.getElementsByTagName("input")[0], button;
if (inp) {
+ inp.focus();
+
if (options.value) {
inp.value = options.value;
if (options.selectValueOnOpen !== false) {
inp.select();
}
@@ -77,11 +79,9 @@
}
if (e.keyCode == 13) callback(inp.value, e);
});
if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close);
-
- inp.focus();
} else if (button = dialog.getElementsByTagName("button")[0]) {
CodeMirror.on(button, "click", function() {
close();
me.focus();
});