Skip to content
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

Odd Behavior when typing a numbered list into a text block #2304

Closed
MackenzieHartung opened this issue May 14, 2019 · 6 comments · Fixed by #2365
Closed

Odd Behavior when typing a numbered list into a text block #2304

MackenzieHartung opened this issue May 14, 2019 · 6 comments · Fixed by #2365
Labels
Bug Something isn't working
Milestone

Comments

@MackenzieHartung
Copy link

  1. Add new text block to story page
  2. Begin typing a numbered list inside text block, "1. "
  3. Upon pressing the space bar after typing "1." the block converts to a numbered list block (correct), but jumps to the top of the page (incorrect)

Screen Shot 2019-05-14 at 10 37 04 AM

Screen Shot 2019-05-14 at 10 37 26 AM

Screen Shot 2019-05-14 at 10 37 34 AM

@MackenzieHartung MackenzieHartung added Bug Something isn't working AMP-Stories labels May 14, 2019
@swissspidy
Copy link
Collaborator

To explain this behavior:

We use some simple automatic text type detection to see whether one is currently writing a heading or a paragraph:

Screenshot 2019-05-14 at 12 19 23

If you type in just one word or something, then it's usually marked as a heading. Now, when entering 1., the editor things you want to insert a list (like in Markdown) and turns the text block into a list block.

There we don't have any text type detection at all, so what you see is the same styling as if you would choose the Paragraph text type:

Screenshot 2019-05-14 at 12 25 18

Now, the sudden jump is less then ideal. However, I cannot think of a good solution right now to improve this. Suggestions welcome.

@amedina
Copy link
Member

amedina commented May 14, 2019

Probably nor urgent prior to stable release, but one possibility would be to remove the ability to add lists that way. This would force lists to be inserted via the main inserter. Not ideal experience but may be better than having to drag the created list to the desired position.

@swissspidy
Copy link
Collaborator

The jumping after the block transformation is a bug and is the most annoying issue here. Let's fix that jumping issue and then test again.

@swissspidy
Copy link
Collaborator

For completeness, here's the list of registered transforms for the list block: https://github.com/WordPress/gutenberg/blob/b193b09c536485a9d06c98a208b3bf76935c9562/packages/block-library/src/list/transforms.js

Basically starting text with 1., 1), *, or - will result in a list block being added.

@miina miina self-assigned this May 20, 2019
@miina miina assigned miina and unassigned miina May 20, 2019
@westonruter westonruter added this to the v1.2 milestone May 21, 2019
@miina
Copy link
Contributor

miina commented May 23, 2019

Notes for QA:

  • Add a Text block.
  • Type in 1. and then space.
  • Verify that nothing changes: the font size stays the same, the block doesn't move to a different location, and it doesn't convert to any other block (still a Text block).
  • Verify the same with typing in 1 and space, * and space, - and space.

@miina miina assigned csossi and unassigned miina May 23, 2019
@csossi
Copy link

csossi commented May 28, 2019

Verified in QA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants