Skip to content

Commit a33cf4a

Browse files
author
Jeremy Press
authored
Fix: Prevent loss of dialog header when adding an annotation on android (#187)
1 parent 2f209d7 commit a33cf4a

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/AnnotationDialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ class AnnotationDialog extends EventEmitter {
483483
} else {
484484
const dataType = util.findClosestDataType(event.target);
485485
if (dataType === CLASS_REPLY_TEXTAREA) {
486-
this.activateReply();
486+
this.scrollToLastComment();
487487
}
488488
}
489489
}

src/MobileAnnotator.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
overflow-y: auto;
9393
padding: 15px;
9494
position: absolute;
95+
top: 48px;
9596
width: 100%;
9697
}
9798

@@ -102,6 +103,8 @@
102103
height: 48px;
103104
justify-content: space-between;
104105
padding: 0;
106+
position: absolute;
107+
top: 0;
105108
width: 100%;
106109
z-index: 160;
107110

src/__tests__/AnnotationDialog-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,15 +544,15 @@ describe('AnnotationDialog', () => {
544544
expect(stubs.hide).to.be.called;
545545
});
546546

547-
it('should activate the reply area when user presses another key inside the reply area', () => {
548-
stubs.activate = sandbox.stub(dialog, 'activateReply');
547+
it('should scroll to the bottom area when user presses a key inside the reply area', () => {
548+
stubs.scrollToLastComment = sandbox.stub(dialog, 'scrollToLastComment');
549549

550550
dialog.keydownHandler({
551551
key: ' ', // space
552552
target: dialog.element.querySelector(`.${CLASS_REPLY_TEXTAREA}`),
553553
stopPropagation: () => {}
554554
});
555-
expect(stubs.activate).to.be.called;
555+
expect(stubs.scrollToLastComment).to.be.called;
556556
});
557557
});
558558

0 commit comments

Comments
 (0)