Compare commits

...

4 Commits

Author SHA1 Message Date
calixteman
cd4a30341f
Merge pull request #19685 from calixteman/issue19424
[Editor] Take into account the parent rotation when switch to edit mode (issue #19424)
2025-03-19 15:15:25 +01:00
Calixte Denizet
276c8f3518 [Editor] Take into account the parent rotation when switch to edit mode (issue #19424) 2025-03-19 14:26:55 +01:00
Jonas Jenwald
1a39e2dac1
Merge pull request #19684 from Snuffleupagus/issue-19683
Improve `addSignatureDescription`/`editSignatureDescription` handling (issue 19683)
2025-03-19 13:43:54 +01:00
Jonas Jenwald
79058c92e3 Improve addSignatureDescription/editSignatureDescription handling (issue 19683)
- Point the `addSignatureDescription` respectively `editSignatureDescription` labels to their actual `input`-elements (this way clicking the label will actually focus the input).

 - Add the event listener to the `addSignatureDescription`-input, rather than its `span`-element (this is consistent with the `editSignatureDescription` case).

 - Correctly check if the `addSignatureDescription`-input is empty, since we're accidentally comparing with its `span`-element.

 - Remove unbalanced, and likely accidentally added, `</span>` tags.
2025-03-19 11:38:56 +01:00
6 changed files with 38 additions and 6 deletions

View File

@ -984,6 +984,7 @@ class HighlightEditor extends AnnotationEditor {
clipPathId,
});
editor.#addToDrawLayer();
editor.rotate(editor.parentRotation);
}
return editor;

View File

@ -2674,4 +2674,34 @@ describe("Highlight Editor", () => {
);
});
});
describe("Highlight must be rotated when existing in the pdf", () => {
let pages;
beforeAll(async () => {
pages = await loadAndWait("issue19424.pdf", ".annotationEditorLayer");
});
afterAll(async () => {
await closePages(pages);
});
it("must check that there is no scroll because of focus", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
await page.evaluate(() => {
window.PDFViewerApplication.rotatePages(90);
});
await page.waitForSelector(
".annotationEditorLayer[data-main-rotation='90']"
);
await switchToHighlight(page);
await page.waitForSelector(
".canvasWrapper svg[data-main-rotation='90']"
);
})
);
});
});
});

View File

@ -713,3 +713,4 @@
!colors.pdf
!red_stamp.pdf
!issue19633.pdf
!issue19424.pdf

BIN
test/pdfs/issue19424.pdf Executable file

Binary file not shown.

View File

@ -187,10 +187,10 @@ class SignatureManager {
},
{ passive: true }
);
description.addEventListener(
this.#description.addEventListener(
"input",
() => {
this.#clearDescription.disabled = description.value === "";
this.#clearDescription.disabled = this.#description.value === "";
},
{ passive: true }
);

View File

@ -716,9 +716,9 @@ See https://github.com/adobe-type-tools/cmap-resources
<div id="addSignatureControls">
<div id="horizontalContainer">
<div id="addSignatureDescriptionContainer">
<label for="addSignatureDescription" data-l10n-id="pdfjs-editor-add-signature-description-label"></span></label>
<label for="addSignatureDescInput" data-l10n-id="pdfjs-editor-add-signature-description-label"></label>
<span id="addSignatureDescription" class="inputWithClearButton">
<input type="text" data-l10n-id="pdfjs-editor-add-signature-description-input" tabindex="0"></input>
<input id="addSignatureDescInput" type="text" data-l10n-id="pdfjs-editor-add-signature-description-input" tabindex="0"></input>
<button class="clearInputButton" type="button" tabindex="0" aria-hidden="true"></button>
</span>
</div>
@ -755,9 +755,9 @@ See https://github.com/adobe-type-tools/cmap-resources
</div>
<div id="editSignatureDescriptionAndView">
<div id="editSignatureDescriptionContainer">
<label for="editSignatureDescription" data-l10n-id="pdfjs-editor-add-signature-description-label"></span></label>
<label for="editSignatureDescInput" data-l10n-id="pdfjs-editor-add-signature-description-label"></label>
<span id="editSignatureDescription" class="inputWithClearButton">
<input type="text" data-l10n-id="pdfjs-editor-add-signature-description-input" tabindex="0"></input>
<input id="editSignatureDescInput" type="text" data-l10n-id="pdfjs-editor-add-signature-description-input" tabindex="0"></input>
<button class="clearInputButton" type="button" tabindex="0" aria-hidden="true"></button>
</span>
</div>