-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[RNMobile] create undo level less frequently #24116
Conversation
Size Change: 0 B Total Size: 1.15 MB ℹ️ View Unchanged
|
Hey @mchowning could you please review and test it? 🙏 Asking you since you have a lot of context on autosave part :) |
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.
This is working well for me. 👍 Nice job @dratwas !
Just noting that it is possible to make changes and very quickly publish a post in a way that loses the most very recent changes (changes that occurred in the last 0.5 seconds before publishing), but this is due to the native code on Android and not because of this PR. In addition, it is quite hard to make this happen.
Description
This is the following PR of #22492
In this PR i added a
selectionStart
andselectionEnd
to transient Edits. The motivation is described here: wordpress-mobile/gutenberg-mobile#2192 (comment)I also added a debounce function to create an undo level when the input (rich-text) stops for over a second to be consistent with the web:
https://github.com/WordPress/gutenberg/blob/master/packages/rich-text/src/component/index.js#L501
It changes how the undo mechanism works on mobile.
In this PR I also added a fix for autosave issue wordpress-mobile/gutenberg-mobile#2349
How has this been tested?
Undo/redo block actions
Undo/redo text
Undo/redo text format
Autosave issue(Android)
Screenshots
Types of changes
Checklist: