diff --git a/src/doc/DocAnnotator.js b/src/doc/DocAnnotator.js index 1cff97435..a1fdb98a5 100644 --- a/src/doc/DocAnnotator.js +++ b/src/doc/DocAnnotator.js @@ -576,7 +576,7 @@ class DocAnnotator extends Annotator { // Do nothing if in a text area or mobile dialog or mobile create dialog is already open const isHidden = this.mobileDialogEl && this.mobileDialogEl.classList.contains(CLASS_HIDDEN); const pointController = this.modeControllers[TYPES.point]; - const isCreatingPoint = pointController && pointController.pendingThreadID !== null; + const isCreatingPoint = !!(pointController && pointController.pendingThreadID); if (isCreatingPoint || !isHidden || document.activeElement.nodeName.toLowerCase() === 'textarea') { return; } diff --git a/src/doc/__tests__/DocAnnotator-test.js b/src/doc/__tests__/DocAnnotator-test.js index 2c5c365f3..8b741fbef 100644 --- a/src/doc/__tests__/DocAnnotator-test.js +++ b/src/doc/__tests__/DocAnnotator-test.js @@ -1107,7 +1107,7 @@ describe('doc/DocAnnotator', () => { annotator.highlighter = { removeAllHighlights: sandbox.stub() }; annotator.modeControllers = { - 'point': { pendingThreadID: null } + 'point': {} }; stubs.getSelStub = sandbox.stub(window, 'getSelection');