click_handlers: Don't focus links on middle / right click.

This commit is contained in:
Gittenburg 2020-07-16 10:46:32 +02:00
parent ffdbf1afec
commit e15189b20c
1 changed files with 11 additions and 1 deletions

View File

@ -739,7 +739,17 @@ exports.initialize = function () {
// Chrome focuses an element when dragging it which can be confusing when // Chrome focuses an element when dragging it which can be confusing when
// users involuntarily drag something and we show them the focus outline. // users involuntarily drag something and we show them the focus outline.
$('body').on('dragstart', (e) => e.target.blur()); $('body').on('dragstart', 'a', (e) => e.target.blur());
// Don't focus links on middle click.
$('body').on('mouseup', 'a', (e) => {
if (e.which === 2) { // middle click
e.target.blur();
}
});
// Don't focus links on context menu.
$('body').on('contextmenu', 'a', (e) => e.target.blur());
(function () { (function () {
const map = { const map = {