-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Multiple update tags #6507
Multiple update tags #6507
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
FWIW there is |
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.
LGTM
@@ -219,6 +219,20 @@ function $normalizeAllDirtyTextNodes( | |||
} | |||
} | |||
|
|||
function addTags(editor: LexicalEditor, tags: undefined | string | string[]) { | |||
if (!tags) { |
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.
be strict here
@@ -219,6 +219,20 @@ function $normalizeAllDirtyTextNodes( | |||
} | |||
} | |||
|
|||
function addTags(editor: LexicalEditor, tags: undefined | string | string[]) { | |||
if (!tags) { |
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.
if (!tags) { | |
if (tags === undefined || tags.length === 0) { |
With
history-merge
being a sort of imposed tag to follow certain behavior, you're forced to trigger anothereditor.update
to pass your own tag. This is a patchy workaround. What's more, this workaround doesn't work fordiscrete
updates.This diff adds support for an array of tags, I kept the
tag
name singular for backward compatibility.