mirror of
https://github.com/wallabag/wallabag.git
synced 2025-03-13 22:52:39 +00:00
Fix esc shortcut after opening add url or search
This commit is contained in:
parent
9a593e6abc
commit
87bf07278a
1 changed files with 11 additions and 0 deletions
|
@ -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);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue