Fix esc shortcut after opening add url or search

This commit is contained in:
Yassine Guedidi 2025-03-09 00:14:55 +01:00
parent 9a593e6abc
commit 87bf07278a

View file

@ -100,5 +100,16 @@ export default class extends Controller {
e.preventDefault();
this.showActionsTarget.click();
});
const originalStopCallback = Mousetrap.prototype.stopCallback;
Mousetrap.prototype.stopCallback = (e, element, combo) => {
// allow esc key to be used in input fields of topbar
if (combo === 'esc' && element.dataset.topbarTarget !== undefined) {
return false;
}
return originalStopCallback(e, element);
};
}
}