annotation: scroll to comment after resize comment list section

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Icbabf5dcdb6f1e01ca0271b2898df28f11810f35
pull/8807/head
Pranam Lashkari 2024-03-15 20:03:00 +05:30 committed by pedropintosilva
parent bac4161583
commit 81b00e7376
1 changed files with 2 additions and 1 deletions

View File

@ -691,7 +691,7 @@ export class CommentSection extends CanvasSectionObject {
}
public select (annotation: Comment, force: boolean = false): void {
if (force || (annotation && !annotation.pendingInit && annotation !== this.sectionProperties.selectedComment)) {
if (annotation && ((!annotation.pendingInit && annotation !== this.sectionProperties.selectedComment) || force)) {
// Unselect first if there anything selected.
if (this.sectionProperties.selectedComment)
this.unselect();
@ -1727,6 +1727,7 @@ export class CommentSection extends CanvasSectionObject {
if (app.view.size.pixels[1] !== lastY) {
app.view.size.pixels[1] = lastY;
this.onResize(); // Annotation goes beyond document and can't be scrolled further unless resized
this.select(this.sectionProperties.selectedComment, true); // Reselecting will bring entire comment in view
}
}
else