From cd2e35e02f5e9c66584a3bc767e5312dcdb81324 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 25 Jul 2023 15:47:04 +0800 Subject: [PATCH] Make sure focused highlight is reset when there is new selection data --- packages/web/components/templates/article/HighlightsLayer.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/web/components/templates/article/HighlightsLayer.tsx b/packages/web/components/templates/article/HighlightsLayer.tsx index 8c76a5055..032b0838e 100644 --- a/packages/web/components/templates/article/HighlightsLayer.tsx +++ b/packages/web/components/templates/article/HighlightsLayer.tsx @@ -539,6 +539,10 @@ export function HighlightsLayer(props: HighlightsLayerProps): JSX.Element { } } + useEffect(() => { + setFocusedHighlight(undefined) + }, [selectionData]) + const dispatchHighlightMessage = (actionID: string) => { if (props.isAppleAppEmbed) { window?.webkit?.messageHandlers.highlightAction?.postMessage({