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

TextArea control not working #1895

Closed
1 task done
jan-clockworkwp opened this issue May 30, 2024 · 4 comments
Closed
1 task done

TextArea control not working #1895

jan-clockworkwp opened this issue May 30, 2024 · 4 comments
Assignees
Labels
type: bug Issue that causes incorrect or unexpected behavior

Comments

@jan-clockworkwp
Copy link

Description

I wonder if anyone is able to use TextAreaControl within the custom block. TextControl works fine, richText as well, but I was not able to make TextAreaControl work. I have followed steps from the official docs as well went through the #1522 and tried various combinations of block.json and editorFields config. When control: 'textarea' is set in editorFields config, no matter what type is set in the block.json file type: string | array | object text area field is not being rendered at all.

Steps to reproduce

  1. Clone block-support repo
  2. Add another attribute with whatever name to the block.json, for example message_area
  3. In Component.js update editorFields config and set control: 'textarea' to the newly added field message_area
  4. Build block and review in the WP admin

Additional context

No response

@faustwp/core Version

3.0.1

@faustwp/cli Version

3.0.1

FaustWP Plugin Version

1.3.1

WordPress Version

6.5.2

Additional environment details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes
@theodesp theodesp added the needs: reproduction This issue needs to be reproduced independently label May 30, 2024
@theodesp
Copy link
Member

theodesp commented May 30, 2024

Hello @jan-clockworkwp. Thank you for the report. It looks like we are indeed missing the handler thats renders the
control: 'textarea' when you define the Component.config.editorFields.

We will provide a small PR soon that provides this functionality.

@theodesp theodesp self-assigned this May 30, 2024
@theodesp theodesp added type: bug Issue that causes incorrect or unexpected behavior and removed needs: reproduction This issue needs to be reproduced independently labels May 30, 2024
@theodesp
Copy link
Member

@jan-clockworkwp @faustwp/block-editor-utils@0.2.1 contains a fix for this issue. I'm closing this ticket, but feel free to comment back if you still have any problems.

@jan-clockworkwp
Copy link
Author

@theodesp I have tested this fix and after updating to @faustwp/block-editor-utils@0.2.1, control: 'textarea' works as expected. Thank you!

@jan-clockworkwp
Copy link
Author

Hi @theodesp, there is one thing I have originally missed and it is the fact that if you use for textarea control type: "object" in the block.json file as described in the faust.js docs, you end up with extra double quotes on the FE causing "Attempt Block Recovery" action in the backend. If you use type "string" in block.json file, all works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Issue that causes incorrect or unexpected behavior
Projects
None yet
Development

No branches or pull requests

2 participants