mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-06 17:41:01 +00:00
Fix esc shortcut after opening add url or search
This commit is contained in:
parent
8b0e6319e4
commit
b266d6ca2f
1 changed files with 11 additions and 0 deletions
|
@ -100,5 +100,16 @@ export default class extends Controller {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.showActionsTarget.click();
|
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…
Add table
Add a link
Reference in a new issue