diff options
author | laurawilsonri <laura_wilson@brown.edu> | 2019-04-08 18:56:45 -0400 |
---|---|---|
committer | laurawilsonri <laura_wilson@brown.edu> | 2019-04-08 18:56:45 -0400 |
commit | 5d4414e8d2a17c75c808bce9343dba85fbb32440 (patch) | |
tree | 4f2249b07c6e2d85056ba1bc5229f99824819d24 /src/client/views/nodes/PDFBox.tsx | |
parent | 218a3bdff2f7c4888b5f21466dee65c36a76ea00 (diff) | |
parent | 4790fd3ff75ace158c47823b5619440d8fd1d879 (diff) |
Merge branch 'richTextEditor' of https://github.com/browngraphicslab/Dash-Web into richTextEditor
Diffstat (limited to 'src/client/views/nodes/PDFBox.tsx')
-rw-r--r-- | src/client/views/nodes/PDFBox.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index 28a1f9757..12208714d 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -151,7 +151,7 @@ export class PDFBox extends React.Component<FieldViewProps> { */ makeEditableAndHighlight = (colour: string) => { var range, sel = window.getSelection(); - if (sel.rangeCount && sel.getRangeAt) { + if (sel && sel.rangeCount && sel.getRangeAt) { range = sel.getRangeAt(0); } document.designMode = "on"; @@ -159,7 +159,7 @@ export class PDFBox extends React.Component<FieldViewProps> { document.execCommand("HiliteColor", false, colour); } - if (range) { + if (range && sel) { sel.removeAllRanges(); sel.addRange(range); |