mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-01 11:57:20 +02:00
Hide comment popup after redo action
This commit is contained in:
parent
84d15dc453
commit
bdc9323b15
@ -1188,6 +1188,7 @@ class AnnotationEditorUIManager {
|
||||
};
|
||||
const cmd = () => {
|
||||
this._editorUndoBar?.show(undo, "comment");
|
||||
this.toggleComment(/* editor = */ null);
|
||||
editor.comment = null;
|
||||
};
|
||||
this.addCommands({ cmd, undo, mustExec: true });
|
||||
|
||||
@ -24,6 +24,8 @@ import {
|
||||
highlightSpan,
|
||||
kbModifierDown,
|
||||
kbModifierUp,
|
||||
kbRedo,
|
||||
kbUndo,
|
||||
loadAndWait,
|
||||
scrollIntoView,
|
||||
selectEditor,
|
||||
@ -1137,5 +1139,43 @@ describe("Comment", () => {
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it("must check that the comment popup is hidden after redo", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
await switchToHighlight(page);
|
||||
await highlightSpan(page, 1, "Abstract");
|
||||
const editorSelector = getEditorSelector(0);
|
||||
const comment = "Test comment for redo";
|
||||
await editComment(page, editorSelector, comment);
|
||||
|
||||
// Show the popup by clicking the comment button
|
||||
await waitAndClick(
|
||||
page,
|
||||
`${editorSelector} .annotationCommentButton`
|
||||
);
|
||||
await page.waitForSelector("#commentPopup", { visible: true });
|
||||
|
||||
// Delete the comment
|
||||
await waitAndClick(page, "button.commentPopupDelete");
|
||||
await page.waitForSelector("#editorUndoBar", { visible: true });
|
||||
|
||||
// Undo the deletion
|
||||
await kbUndo(page);
|
||||
await page.waitForSelector("#editorUndoBar", { hidden: true });
|
||||
|
||||
// Show the popup again by clicking the comment button
|
||||
await waitAndClick(
|
||||
page,
|
||||
`${editorSelector} .annotationCommentButton`
|
||||
);
|
||||
await page.waitForSelector("#commentPopup", { visible: true });
|
||||
|
||||
// Redo the deletion - popup should be hidden
|
||||
await kbRedo(page);
|
||||
await page.waitForSelector("#commentPopup", { hidden: true });
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user