mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[Editor] Wait for 'pagerendered' to switch to editing mode
The focus can potentially be stolen when the DOM is modified when adding a new canvas element for the page being redrawn.
This commit is contained in:
parent
7ffea2f02a
commit
d27efb43cd
1 changed files with 3 additions and 3 deletions
|
@ -2328,9 +2328,9 @@ class PDFViewer {
|
|||
// We must call #switchToEditAnnotationMode unconditionally to ensure that
|
||||
// page is rendered if it's useful or not.
|
||||
const idsToRefresh = this.#switchToEditAnnotationMode();
|
||||
if (isEditing && editId && idsToRefresh) {
|
||||
// We're editing an existing annotation so we must switch to editing
|
||||
// mode when the rendering is done.
|
||||
if (isEditing && idsToRefresh) {
|
||||
// We're editing so we must switch to editing mode when the rendering is
|
||||
// done.
|
||||
this.#cleanupSwitchAnnotationEditorMode();
|
||||
this.#onPageRenderedCallback = ({ pageNumber }) => {
|
||||
idsToRefresh.delete(pageNumber);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue