See video. When I have a text for which I inserted a line before and after the text (by pressing the enter key), I get the right effect I wanted. However, when I enter edit mode for that text element the before and after lines are removed. This shouldn't be happening.
Lines should not be removed when I re-enter text edit mode for that text element.
_Do not alter or remove anything below. The following sections will be managed by moderators only._
@barklund / @merapi - we think that this is a good candidate for the Pea pod, but wanted to confirm that @merapi work on text isn't going to solve. Please confirm.
@bmattb This is unrelated to my fixes and looks like https://github.com/google/web-stories-wp/issues/1952 is related and maybe https://github.com/google/web-stories-wp/issues/2788
Additional findings:
It appears some sort of .trim() functionality is occurring onClick of the Edit or TextFrame text component (or a child of). If you add two line breaks to start of a text element and two line breaks to the end then click off and then click back on, the two outside line breaks are removed with two still existing.
Edit:
Definitely seems like the .trim() like functionality is occurring during mount/early render of EditLayer
Tested PR 3543 (Win10/Chrome)
The effect is hidden from the user if they resize text with a blank line above and below (note: they can see it if they go into Edit mode)
Start:
Grabbed right side handle and dragged slightly to right and released:
The testing instructions were:
- Create or open an existing story
- Create a textbox with some dummy text
- Include a linebreak as the first character and as the last
- Click off the canvas to exit Edit Mode
- Double back on the text box to enter Edit Mode
- See that the text height remains the same and the linebreaks are preserved
@csossi Did that work as expected?
If so, it sounds like the issue you noticed with the resizing warrants its own ticket. Because this ticket here is all about the edit mode.
cc @dmmulroy
You're correct, @swissspidy - and it therefore DID work as expected. Passing
Ah, looks like the resizing issue is covered by #1952
Most helpful comment
Ah, looks like the resizing issue is covered by #1952