mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-05 15:19:02 +02:00
Merge pull request #26909 from overleaf/dp-eq-preview-presentation-mode
Prevent codemirror tooltips appearing on top of pdf preview GitOrigin-RevId: 0c6ce15cd91b4958674fbc247bcd27ce5778f7fc
This commit is contained in:
@@ -21,6 +21,7 @@ import { isMac } from '@/shared/utils/os'
|
||||
import { sendSearchEvent } from '@/features/event-tracking/search-events'
|
||||
import { useRailContext } from '@/features/ide-redesign/contexts/rail-context'
|
||||
import usePersistedState from '@/shared/hooks/use-persisted-state'
|
||||
import { repositionAllTooltips } from '@/features/source-editor/extensions/tooltips-reposition'
|
||||
|
||||
export type IdeLayout = 'sideBySide' | 'flat'
|
||||
export type IdeView = 'editor' | 'file' | 'pdf' | 'history'
|
||||
@@ -198,6 +199,15 @@ export const LayoutProvider: FC<React.PropsWithChildren> = ({ children }) => {
|
||||
[setPdfLayout, setView]
|
||||
)
|
||||
|
||||
// Force codemirror to reposition all tooltips to prevent an issue
|
||||
// where tooltips would sometimes show on top of the pdf preview
|
||||
// https://github.com/overleaf/internal/issues/23840
|
||||
useEffect(() => {
|
||||
if (view === 'pdf' && pdfLayout === 'flat') {
|
||||
repositionAllTooltips()
|
||||
}
|
||||
}, [view, pdfLayout])
|
||||
|
||||
const {
|
||||
reattach,
|
||||
detach,
|
||||
|
||||
Reference in New Issue
Block a user