Web-stories-wp: Text height changing

Created on 3 Jun 2020  路  7Comments  路  Source: google/web-stories-wp

Bug Description

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.

Expected Behaviour

Lines should not be removed when I re-enter text edit mode for that text element.

Steps to Reproduce

Screenshots

See video

Additional Context

  • Plugin Version:
  • Operating System:
  • Browser:

_Do not alter or remove anything below. The following sections will be managed by moderators only._

Acceptance Criteria

Implementation Brief

P1 Pea Bug

Most helpful comment

Ah, looks like the resizing issue is covered by #1952

All 7 comments

@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:
image.png

Grabbed right side handle and dragged slightly to right and released:
image.png

The testing instructions were:

  1. Create or open an existing story
  2. Create a textbox with some dummy text
  3. Include a linebreak as the first character and as the last
  4. Click off the canvas to exit Edit Mode
  5. Double back on the text box to enter Edit Mode
  6. 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

Was this page helpful?
0 / 5 - 0 ratings