-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lexical-history][lexical-selection][lexical-react] Fix: #6409 TextNode change detection #26
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,13 +17,15 @@ export {createEmptyHistoryState} from '@lexical/history'; | |
export type {HistoryState}; | ||
|
||
export function HistoryPlugin({ | ||
delay, | ||
externalHistoryState, | ||
}: { | ||
delay?: number; | ||
externalHistoryState?: HistoryState; | ||
}): null { | ||
const [editor] = useLexicalComposerContext(); | ||
|
||
useHistory(editor, externalHistoryState); | ||
useHistory(editor, externalHistoryState, delay); | ||
|
||
return null; | ||
} | ||
Comment on lines
19
to
31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current implementation of
isTextNodeUnchanged
usesJSON.stringify
andexportJSON
to compare text nodes. This approach might miss some subtle changes or introduce unnecessary comparisons. Consider implementing a more direct comparison of the relevant properties of the text nodes, such as__text
,__mode
,__format
, and__style
. This will ensure more accurate change detection and potentially improve performance.