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
[Tiny PR] RichText: correctly update value after undo #17840
Conversation
Seems to be an issue with RichText not applying the change. |
Seems to be introduced in #15496. |
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.
I haven't tested this extensively, but it does the job for me.
if ( shouldReapply ) { | ||
this.value = value; | ||
this.record = this.formatToValue( value ); | ||
this.record.start = selectionStart; | ||
this.record.end = selectionEnd; | ||
|
||
updateFormats( { |
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.
So was updateFormats
mutating the record back to a state with the previous formats? Is that it?
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.
Yes, that's it. :) I'm not sure why it's here, I probably made a mistake.
Thanks for the review! |
Description
See #17839. RichText is not removing formatting after undo. This is caused by
updateFormats
, which seems to be called in that place for no reason. Looks like I made a mistake calling it there.How has this been tested?
Screenshots
Types of changes
Checklist: