-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
fix: don't mutate the bounded text if not updated when submitted #4543
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/excalidraw/excalidraw/86BfnGMynX2iq4KZKm6TTj1u6s6b |
src/element/textWysiwyg.tsx
Outdated
const updatedElement = Scene.getScene(element)!.getElement( | ||
element.id, | ||
) as ExcalidrawTextElement; | ||
prevText = updatedElement.text; |
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.
doesn't this assignment make the prevText
variable always equivalent to updatedElement.text
, removing the need to cache it at all?
…ssue after editing and add specs
Good catch!. Updated the implementation to cache |
🚀 |
Attempt fix the "undo twice for first time when bounded text properties updated by selecting text explicitly" mentioned in #4537
Previous
Now