Skip to content

Bolding text using the toolbar causes whitespace to be lost #1966

@guarani

Description

@guarani

Description

When bolding text using the toolbar button on iOS or Android, any whitespace present at the beginning of the line is removed causing the the text to jump to the left and the whitespace to be lost. This affects the pre-formatted block, the verse block, and, to a lesser extent, the paragraph block. This issue is not present on Gutenberg web.

On iOS, bolding through the native iOS edit menu (the toolbar menu that displays selection options) is not affected by this bug.

The same bug is present for italics or strikethrough.

Steps to Reproduce

There are two distinct scenarios where this bug is present.

Scenario 1: Styling non-selected text

In a paragraph block, type some spaces, then tap the toolbar bold button and observe that the cursor jumps back to the start of the line. The cursor should stay put when the bold button is tapped.

Scenario 2: Styling selected text

  1. In a paragraph (or verse or pre-formatted) block, type some spaces and then text, such as:
    Hello
  1. Bold the Hello portion of the line using the toolbar bold B button (on iOS, don't use the native iOS edit menu)
  2. Observe the text has shifted to the left and the whitespace has disappeared
  3. The same occurs for the toolbar italics and strikethrough options
iOS Android

Expected Behavior

Applying bold/italics/strikethrough to text should not affect leading whitespace or reposition the text in any way.

Devices

iOS Android
Device iPhone 7 Google Pixel Emulator
OS iOS Android 10
OS Version 13.3.1 API 29 Version Q

Additional Context

This bug is present in the Gutenberg editor in the WordPress for iOS app and in the Gutenberg example iOS and Android projects in this repo. It is not present on the Aztec for iOS example app or the WordPress for iOS Classic editor.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions