fix: allow command k trigger inside input

This commit is contained in:
sokumon 2026-01-16 14:42:15 +05:30
parent 0b176ec42f
commit 04eb2517cd

View file

@ -55,6 +55,18 @@ frappe.ui.form.ControlInput = class ControlInput extends frappe.ui.form.Control
// like links, currencies, HTMLs etc.
this.disp_area = this.$wrapper.find(".control-value").get(0);
}
this.setup_shortcut();
}
setup_shortcut() {
$(this.input_area).on("keydown", function (event) {
if (event.originalEvent.ctrlKey || event.originalEvent.metaKey) {
if (event.originalEvent.key === "k" || event.originalEvent.key === "K") {
$("#navbar-modal-search").click();
event.preventDefault();
return false;
}
}
});
}
set_max_width() {
if (this.constructor.horizontal) {