mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 23:28:06 +02:00
Handtool: Remove focus from previous node on click
"This commit fixes the issue that a focused element cannot lose
focus when the draggable element is clicked."
11c368f97c
Steps to reproduce/verify:
1. Enable the hand tool (e.g. by using the H shortcut)
2. Click on the Page number input.
3. Click or drag the PDF canvas.
4. Observe that the page number input is still focused.
Consequently, the hand tool cannot be disabled using the H shortcut.
This commit is contained in:
parent
8042a4b783
commit
204d540af2
1 changed files with 5 additions and 0 deletions
|
@ -135,6 +135,11 @@ var GrabToPan = (function GrabToPanClosure() {
|
|||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
this.document.documentElement.classList.add(this.CSS_CLASS_GRABBING);
|
||||
|
||||
var focusedElement = document.activeElement;
|
||||
if (focusedElement && !focusedElement.contains(event.target)) {
|
||||
focusedElement.blur();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue