Skip to content

Conversation

@AKSHAT2802
Copy link
Contributor

@AKSHAT2802 AKSHAT2802 commented Nov 19, 2024

Resolves #51814

What?

Replaces TextControl with TextAreaControl to enhance UI for adding additional classes for blocks

Why?

To make better visibility of added additional classes for any block

How?

Replaced TextControl with TextAreaControl and also sanitized the value to replace line breaks, tabs and multiple spaces with single space to maintain structure.

Screenshots or screencast

Screenshot 2024-11-20 at 12 36 55 AM Screenshot 2024-11-20 at 12 37 36 AM

@github-actions
Copy link

github-actions bot commented Nov 19, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @porg.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: porg.

Co-authored-by: AKSHAT2802 <akshat2802@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@im3dabasia im3dabasia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall Looks good 🚀

attributes.className
);
// Sanitize the className here by removing newlines, tabs, and extra spaces
const sanitizedClassName = attributes.className
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this is intended to help prevent such situations. Looping in @Mamaduka for his input on this approach.

Screen.Recording.2025-09-05.at.4.02.05.PM.mov

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

Labels

[Package] Block editor /packages/block-editor [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Additional CSS class(es): Text input field shall get multiline textarea.

3 participants