Merge pull request #13408 from Snuffleupagus/zoom-click-blur
Remove focus from the zoom dropdown, when a mouse is used (bug 1300525, issue 4923)
This commit is contained in:
commit
5fdb12661b
@ -155,6 +155,19 @@ class Toolbar {
|
|||||||
value: this.value,
|
value: this.value,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
// Here we depend on browsers dispatching the "click" event *after* the
|
||||||
|
// "change" event, when the <select>-element changes.
|
||||||
|
scaleSelect.addEventListener("click", function (evt) {
|
||||||
|
const target = evt.target;
|
||||||
|
// Remove focus when an <option>-element was *clicked*, to improve the UX
|
||||||
|
// for mouse users (fixes bug 1300525 and issue 4923).
|
||||||
|
if (
|
||||||
|
this.value === self.pageScaleValue &&
|
||||||
|
target.tagName.toUpperCase() === "OPTION"
|
||||||
|
) {
|
||||||
|
this.blur();
|
||||||
|
}
|
||||||
|
});
|
||||||
// Suppress context menus for some controls.
|
// Suppress context menus for some controls.
|
||||||
scaleSelect.oncontextmenu = noContextMenuHandler;
|
scaleSelect.oncontextmenu = noContextMenuHandler;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user