Skip to content
This repository was archived by the owner on Jul 9, 2026. It is now read-only.
This repository was archived by the owner on Jul 9, 2026. It is now read-only.

Quote block placeholder is not visible #1970

Closed
WordPress/gutenberg
#22561

Description

@ceyhun

Describe the bug

Quote block's Write Quote... placeholder is not visible on Android

To Reproduce

  1. Add Quote block
  2. The Write Quote... placeholder on top of Write Citation... placeholder doesn't appear on Android

Expected behavior

There should be a Write Quote... placeholder on top of Write Citation... placeholder

Screenshots

Android iOS
android-quote ios-quote

Smartphone (please complete the following information):

  • Device: Nexus 5X API 29 x86 emulator
  • OS: Android 10.0
  • Version: 1.24.0

Additional context

Realised this while implementing Pullquote block: #1920
WordPress/gutenberg#20265

Quote block uses RichText to implement the text inputs and issue seems to be with that component. For the Quote block the only difference between the quote and citation input fields is that the quote input gets the multiline prop passed in: https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/quote/edit.js#L45

When multiline prop is removed it works as expected.

Activity

  1. added
    [Type] Bug
    on May 5, 2020
  2. changed the title [-][Android] Quote block placeholder is not visible[/-] [+]Quote block placeholder is not visible[/+] on May 5, 2020
  3. self-assigned this
    on May 21, 2020
  4. cameronvoell commented on May 22, 2020

    @cameronvoell
    Contributor

    Going to save a few notes on here (perhaps for myself).

    We are seeing the missing placeholder because multiline prop/functionality causes empty paragraph tags (<p></p>) to be sent to our RichText, and it needs to be completely empty for the placeholder to be shown. See note in comment here:
    https://github.com/WordPress/gutenberg/blob/316c2f9ef46ed821190e2229ba0b71d01c2bd54a/packages/rich-text/src/component/index.native.js#L681-L684

    If we simply catch when we have an empty paragraph tag, and set the text to an empty string (""), we start seeing some immediate problems. Basically some of the functionality around selecting and manipulating multiline quotations is currently reliant on the paragraph tags being there, even when the actual text content is empty. My strategy so far has been trying to fix all the places that need the paragraph tags even for empty content, in order to work. For example this function was breaking if we simply remove paragraph tags for empty strings https://github.com/WordPress/gutenberg/blob/master/packages/rich-text/src/component/index.native.js#L532-L538

    Unfortunately, even after a few small victories, I was still seeing some broken behaviors when merging blocks or doing multiline quotes with my strategy of deleting paragraph tags on empty blocks, and fixing the code reliant on them. An alternate strategy is to go to the AztecText on the AztecEditor-Android side and try and catch empty paragraph tags there and still show the placeholder text. As seen in the following link, we're already doing this with some end of line characters, so this could be a viable strategy, but will just be slower to test, and potentially more dangerous with affecting other users of AztecAndroid: https://github.com/wordpress-mobile/AztecEditor-Android/blob/1e09b7daa88498c2c8d62b09cee0c8af8bb86616/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt#L1795-L1801

  5. cameronvoell commented on May 23, 2020

    @cameronvoell
    Contributor

    I was still seeing some broken behaviors when merging blocks or doing multiline quotes with my strategy of deleting paragraph tags on empty blocks, and fixing the code reliant on them.

    I was able to get this working with a relatively safe looking change. The fix itself appears a bit unintuitive, and could probably use a larger refactor, but the more minimal change here in the following PR's seemed like the least intrusive way to fix this in the near term:
    Gutenberg PR: WordPress/gutenberg#22561
    Gutenberg-Mobile PR: #2307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[OS] Android[Type] Bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions