From baf9b70561ad58334f0045336c530c34a7dbf064 Mon Sep 17 00:00:00 2001 From: Sumedha Pramod Date: Mon, 7 Aug 2017 13:22:17 -0700 Subject: [PATCH] Chore: Force image point dialogs to re-position on re-render (#280) --- src/lib/annotations/image/ImagePointThread.js | 3 +++ src/lib/annotations/image/__tests__/ImagePointThread-test.js | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/lib/annotations/image/ImagePointThread.js b/src/lib/annotations/image/ImagePointThread.js index 5f455f4ed..f20e815bb 100644 --- a/src/lib/annotations/image/ImagePointThread.js +++ b/src/lib/annotations/image/ImagePointThread.js @@ -36,6 +36,9 @@ class ImagePointThread extends AnnotationThread { if (this.state === STATES.pending) { this.showDialog(); + + // Force dialogs to reposition on re-render + this.dialog.position(); } } diff --git a/src/lib/annotations/image/__tests__/ImagePointThread-test.js b/src/lib/annotations/image/__tests__/ImagePointThread-test.js index c227d467b..670681fb1 100644 --- a/src/lib/annotations/image/__tests__/ImagePointThread-test.js +++ b/src/lib/annotations/image/__tests__/ImagePointThread-test.js @@ -25,6 +25,10 @@ describe('lib/annotations/image/ImagePointThread', () => { threadID: 2, type: 'point' }); + + thread.dialog = { + position: sandbox.stub() + }; }); afterEach(() => { @@ -55,6 +59,7 @@ describe('lib/annotations/image/ImagePointThread', () => { thread.show(); expect(thread.showDialog).to.have.been.called; + expect(thread.dialog.position).to.have.been.called; }); it('should not show the dialog if the state is not pending', () => {