Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Richtext : "multiline=p" property is not working in latest WP version #59318

Open
md-kushang-tailor opened this issue Feb 23, 2024 · 1 comment
Labels
[Package] Rich text /packages/rich-text [Type] Bug An existing feature does not function as intended

Comments

@md-kushang-tailor
Copy link

Description

Issue:

I'm facing issues with the Richtext component When I'm used "multiline=p" property in latest WP version - 6.4.x.

The scenario I've:

I've one custom GB slider block that includes some Richtext for contents, Gallery for images and links as multi-level functionality.

Multi-level functionality:

  • On click of Plus Button, The slider will increase by one with all the empty/placeholder contents & components.
  • On click of Minus/Remove Button, The current active slider will remove completely.

After updating WP to the latest version the "multiline=p" property not working properly. I don't know why this is happened. But, I've many posts to depends on the "multiline=p" property, Because using this property, The contents of the slider's automatically converted all the copied heading tags & List items into different paragraph tags. But, Now in latest WP version, When I added copied contents, It's throw the content like [object Object].

I have a below code, After WordPress 6.3 > when I published WordPress 6.4.x and copy any heading like text from doc file to WordPress it gives below error.

In other hand, I've some document files ready for this slider's content so I just copied all the contents from that document file and added here in this block.

Is there any way like it should not add the above content when multiline enabled?

Note: Above only happens when multiline enabled in rich text in WordPress latest version ( 6.4.x ).

As it seems like multiline prop is removed after WordPress 6.4, and it suggests alternative of inner blocks. While I have serverside render functionality with custom slider so my rich text is repeating in loop. And I assume that this will not work with inner blocks in loop with serverside render.

My block example: https://share.cleanshot.com/wRh8VvjdFgSpDKXYwXrb

Please suggest any other solution if any can work for above situation.

Thanks!

Step-by-step reproduction instructions

Custom Gallery slider Block

I have serverside render functionality with custom slider so my rich text is repeating in loop.

Screenshots, screen recording, code snippet

The Code example:

<RichText
	tagName="p"
	placeholder={__('Heading', 'test')}
	value={heading}
	onChange={heading => setAttributes({ heading })}
	multiline="p"
/>

Environment info

No response

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

@md-kushang-tailor md-kushang-tailor added the [Type] Bug An existing feature does not function as intended label Feb 23, 2024
@Mamaduka Mamaduka added the [Package] Rich text /packages/rich-text label Feb 23, 2024
@Mamaduka
Copy link
Member

The multiline has been deprecated since WP 6.1. This is the only related change I can find for 6.4 - #54998 (comment).

I would recommend migrating away from the deprecated prop/feature.

rosamaggi added a commit to epfl-si/wp-gutenberg-epfl that referenced this issue Nov 11, 2024
rosamaggi added a commit to epfl-si/wp-gutenberg-epfl that referenced this issue Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Rich text /packages/rich-text [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants