diff options
author | eperelm2 <emily_perelman@brown.edu> | 2023-08-24 20:54:45 +0200 |
---|---|---|
committer | eperelm2 <emily_perelman@brown.edu> | 2023-08-24 20:54:45 +0200 |
commit | f189b4f65163a7bc231b5aa57f01d915f953931d (patch) | |
tree | b8bd6fba593a29319972a40a07f572063b300b25 /src/client/views/nodes/WebBox.tsx | |
parent | 2fcad5e8bd1412487b4fcacefdc12a2df5707638 (diff) | |
parent | 372face940712d239d48f9884ded34d82d170a94 (diff) |
filter - made small finishing changes
Diffstat (limited to 'src/client/views/nodes/WebBox.tsx')
-rw-r--r-- | src/client/views/nodes/WebBox.tsx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx index 34a1229ba..f5df42161 100644 --- a/src/client/views/nodes/WebBox.tsx +++ b/src/client/views/nodes/WebBox.tsx @@ -125,11 +125,15 @@ export class WebBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps this._searchRef.current?.setRangeText(searchString); }); } - if (clear) { - this._iframe?.contentWindow?.getSelection()?.empty(); - } - if (searchString) { - (this._iframe?.contentWindow as any)?.find(searchString, false, bwd, true); + try { + if (clear) { + this._iframe?.contentWindow?.getSelection()?.empty(); + } + if (searchString) { + (this._iframe?.contentWindow as any)?.find(searchString, false, bwd, true); + } + } catch (e) { + console.log("WebBox search error", e) } return true; }; |