Skip to content

Toolbar showing for TextControl when RichText is not selected #7463

Closed

Description

Follow the test method descriped in Issue #16651 as the test case involved a core block.


I have created a block with both TextControl and RichText.

When I select the RichText I get the toolbar but the toolbar does not disappear when the TextControl is selected. I have tested this with Gutenberg 3.1

Here is a screenshot of the block with the TextControl and RichText.
image

I have created a example plugin where this can be tested: grappler-block.zip

The code it the edit is

<div className={ className }>
	<TextControl
		label={ __( 'TextControl' ) }
		value={ attributes.textControl || '' }
		type="text"
		onChange={ ( newValue ) => {
			setAttributes( { textControl: newValue } );
		} }
	/>

	<RichText
		multiline="li"
		tagName="ul"
		formattingControls={ [ 'bold', 'link' ] }
		value={ attributes.richText }
		placeholder={ __( 'RichText' ) }
		onChange={ ( content ) => setAttributes( { richText: content } ) }
	/>
</div>

This was previously working with a custom onFocus.

Related PRs #7029 & #6871

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

Metadata

Assignees

No one assigned

    Labels

    Needs DevReady for, and needs developer efforts[Feature] Rich TextRelated to the Rich Text component that allows developers to render a contenteditable[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions