This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'; | |
import { useEffect, useCallback } from 'react'; | |
// doesn't work in Firefox (but is in Firefox nightly) | |
// https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API#browser_compatibility | |
// | |
// highlights the given search terms in the editor | |
// then scrolls to the first search term and selects it | |
export function SearchHighlighterPlugin({ |