Gutenberg Richtext generating “” in editor
-
I have used rich text element of Gutenberg, in editor i found this kind of entity coming when we are editing –?https://prnt.sc/uqJZokTorIK_ , that is creating issue in layout, when we click its showing blank space.
/** * WordPress dependencies */ import { __ } from "@wordpress/i18n"; import { RichText, useBlockProps } from "@wordpress/block-editor"; import { Platform } from "@wordpress/element"; export default function edit({ attributes, setAttributes }) { const {circleHeadline,circleText} = attributes; const blockProps = useBlockProps({ className: 'visual-circle__item', }); const onTitleChange = (value) => { const newTitle = { circleHeadline: value }; setAttributes(newTitle); }; const onTextChange = (value) => { const newText = { circleText: value }; setAttributes(newText); }; return ( <li {...blockProps}> <RichText identifier="circleHeadline" tagName="span" className="visual-circle__title" value={circleHeadline} onChange={onTitleChange} withoutInteractiveFormatting={true} aria-label={__("Main Text")} placeholder={__("Lorem")} {...(Platform.isNative && { deleteEnter: true })} // setup RichText on native mobile to delete the "Enter" key as it's handled by the JS/RN side allowedFormats={[""]} /> <RichText identifier="circleText" tagName="span" className="visual-circle__text" value={circleText} onChange={onTextChange} withoutInteractiveFormatting={true} aria-label={__("Sub Text")} placeholder={__("Nullam dictum eu pede")} {...(Platform.isNative && { deleteEnter: true })} // setup RichText on native mobile to delete the "Enter" key as it's handled by the JS/RN side allowedFormats={[""]} /> </li> ); }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Gutenberg Richtext generating “” in editor’ is closed to new replies.