mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-28 19:41:33 +02:00
Merge pull request #20785 from overleaf/dp-sticky-highlights
Clear op highlight on review-panel-entry dismount GitOrigin-RevId: 9892df75f35fcb0440bd19bcfbaa276a3db033a1
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { FC, useCallback, useState } from 'react'
|
||||
import { FC, useCallback, useEffect, useState } from 'react'
|
||||
import { AnyOperation } from '../../../../../types/change'
|
||||
import {
|
||||
useCodeMirrorStateContext,
|
||||
@@ -44,6 +44,15 @@ export const ReviewPanelEntry: FC<{
|
||||
setFocused(true)
|
||||
}, [selectLineOnFocus, docId, openDocId, position])
|
||||
|
||||
// Clear op highlight on dismount
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (hoverRanges) {
|
||||
view.dispatch(clearHighlightRanges(op))
|
||||
}
|
||||
}
|
||||
}, []) // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
return (
|
||||
<div
|
||||
onFocus={focusHandler}
|
||||
|
||||
Reference in New Issue
Block a user