Skip to content
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: assign the original text to text editor only during init #6580

Merged
merged 1 commit into from
May 13, 2023

Conversation

ad1992
Copy link
Member

@ad1992 ad1992 commented May 12, 2023

Fixes #6576, #5837

@vercel
Copy link

vercel bot commented May 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
excalidraw ✅ Ready (Inspect) Visit Preview May 12, 2023 6:10am
excalidraw-package-example ✅ Ready (Inspect) Visit Preview May 12, 2023 6:10am
1 Ignored Deployment
Name Status Preview Updated (UTC)
docs ⬜️ Ignored (Inspect) May 12, 2023 6:10am

@dwelle
Copy link
Member

dwelle commented May 12, 2023

this also fixes undo/redo in wysiwyg. Wasn't there a reason for setting the editable.value on update?

@ad1992
Copy link
Member Author

ad1992 commented May 12, 2023

this also fixes undo/redo in wysiwyg. Wasn't there a reason for setting the editable.value on update?

I don't think there was any specific reason to do it on update. The only reason to set is so text editor uses originalText and not text for word wrapping in editor when updating but that should be only during init and then we shouldn't interrupt the text editor so earlier we were updating it during typing which is not right but this never got noticed.

Is there any issue opened about undo/redo on GH which I can link here ?

Also there is one more clean up PR which you can take a look when you get a chance (not urgent but simplifies couple of things) - #6520

@ad1992
Copy link
Member Author

ad1992 commented May 12, 2023

So I think this is how it got introduced, before pushing text containers we were updating editable.value inside update only and I had changed it to originalText instead in #4343
Screenshot 2023-05-12 at 2 35 31 PM

Though for regular text it will not be an issue since there is no wrapping happening but for text containers it is an issue specially for diff langs.
But still in any case we still shouldn't be interrupting editor when updating.
@dwelle do you know if there was any reason why we were updating even before ?
Probably this was sort of code which has been there from begining and since it was working with English so never got noticed.

@dwelle
Copy link
Member

dwelle commented May 12, 2023

Is there any issue opened about undo/redo on GH which I can link here ?

I'd swear I did create one but couldn't find the issue yesterday.

@dwelle do you know if there was any reason why we were updating even before ?

no, but I guess we'll find out 😀

Alright, let's ship!

@dwelle dwelle merged commit e0f2869 into master May 13, 2023
8 checks passed
@dwelle dwelle deleted the aakansha-fix-editable-value-containers branch May 13, 2023 17:17
alswl pushed a commit to alswl/excalidraw that referenced this pull request Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Japanese text input inside a container does not work properly
2 participants