Make sure you have 3 paragraphs (for example <p>Line 1</p><p>Line 2</p><p>Line 3</p>
Click at the end of "Line 1"
Add a new line ("enter")
Add an image (or a placeholder)
Notice it gets actually added after the "Line 2" instead of "Line 1"
The reason for this was that when the cursor is in a paragraph block, it's trying to add the image at the next line break. However, if it's on a line break, it should use that instead of looking for the next one after the current cursor position.
Test (or test it with the linked PR)
turn the addMediaAfterBlocks on the visual editor
Make sure you have 3 paragraphs (for example <p>Line 1</p><p>Line 2</p><p>Line 3</p>
Click at the end of "Line 1"
Add a new line ("enter")
Add an image (or a placeholder)
Notice it gets added after "Line 1"
Review
@khaykov
Make sure strings will be translated:
[x] If there are new strings that have to be translated, I have added them to the client's strings.xml as a part of the integration PR.
Fix
The issue fixed here is:
addMediaAfterBlocks
on the visual editor<p>Line 1</p><p>Line 2</p><p>Line 3</p>
The reason for this was that when the cursor is in a paragraph block, it's trying to add the image at the next line break. However, if it's on a line break, it should use that instead of looking for the next one after the current cursor position.
Test (or test it with the linked PR)
addMediaAfterBlocks
on the visual editor<p>Line 1</p><p>Line 2</p><p>Line 3</p>
Review
@khaykov
Make sure strings will be translated:
strings.xml
as a part of the integration PR.