-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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] Split pasted content between title and body #37169
Conversation
Size Change: 0 B Total Size: 1.37 MB ℹ️ View Unchanged
|
Testing commit 2d847e2 on both the iOS and Android demo apps:
The text I pasted in to the editor to test this is found here: https://wordpress.org/news/2021/11/state-of-the-word-2021. I copied the text starting from "Howdy, World!" up to and including "Word 2021!". The "image followed by text" I used in the above test is found here: https://wordpress.org/support/article/how-to-use-gravatars/#what-is-a-gravatar |
2d847e2
to
5e4cd27
Compare
if ( typeof content === 'string' ) { | ||
const valueToInsert = create( { html: content } ); | ||
onChange( insert( value, valueToInsert ) ); | ||
if ( typeof content !== 'string' && content.length ) { |
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 was curious about what happens when pasting a string since it looks like that is no longer handled.
So far I have only tested Android, pasting blocks works fine but a non block paste does not:
paste-android.mp4
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 am on Android 12 , Pixel 5
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.
Thanks for catching this 🤦. I forgot the most straightforward case.
Flaky tests detected in 2c3b298. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4685002483
|
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.
Nice work @guarani! I can confirm this resolves the issue through the test cases mentioned in this comment. Approving and merging. 🚀
Thanks for helping get this across the line @derekblank! ❤️ |
Description
Similar to #21758, when pasting content into the post title, split pasted content between title and body.
Related:
Split pasted content between title and body wordpress-mobile/gutenberg-mobile#4350How has this been tested?
I ran through the following test cases (see comment below):
Screenshots
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).