Skip to content

RichText doesn't allow typing if these is a placeholder present. #59192

@Mgrmjp

Description

@Mgrmjp

Description

In a custom Gutenberg blog importing RichText and using it doesn't allow for typing at all. The cursor blinks and onChange always returns empty. On PlainText no issues.

Step-by-step reproduction instructions

Use RichText in a block:

                        el(RichText, {
                            tagName: "span",
                            className: "name",
                            // style: { display: 'flex' },
                            value: attributes.name || '',
                            onChange: value => {
                                setAttributes({ name: value })
                            },
                            placeholder: __('Nimi', 'ID'),
                        }),

Set a placeholder.

Render block on editor

Click on the text that has placeholder present.

Try to write.

Doesn't do anything.


Could be something in the older style of blocks, but can't really change everything in an older theme.

Screenshots, screen recording, code snippet

richtext

Environment info

Problem on Chrome at least.

WordPress 6.4.3

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

Labels

[Feature] Rich TextRelated to the Rich Text component that allows developers to render a contenteditable[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions