1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Merge pull request #18418 from calixteman/wait_for_rendering

[Editor] Wait for 'pagerendered' to switch to editing mode
This commit is contained in:
calixteman 2024-07-10 12:18:21 +02:00 committed by GitHub
commit b1bf8b4979
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);