Skip to content

Clicking enter when non-textual blocks are selected creates a new paragraph even if not allowed. #10186

@youknowriad

Description

@youknowriad

Related #10136 (review)

Create a container block where the paragraph block is not allowed

wp.blocks.registerBlockType('test/container', {
	title: 'container',
	category: 'common',
	description: 'container',
	icon: 'yes',

	edit() {
		return wp.element.createElement(wp.editor.InnerBlocks, {
			allowedBlocks: ['core/image', 'core/gallery']
		});
	},

	save() {
		return wp.element.createElement(wp.editor.InnerBlocks.Content);
	},
})
  • Add an image block inside this container
  • Select the image placeholder and hit enter
  • A new paragraph block is inserted even if not allowed

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions