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

[Bug] Add missing textarea control handler. #1898

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

theodesp
Copy link
Member

@theodesp theodesp commented May 30, 2024

Tasks

  • I have signed a Contributor License Agreement (CLA) with WP Engine.
  • If a code change, I have written testing instructions that the whole team & outside contributors can understand.
  • I have written and included a comprehensive changeset to properly document the changes I've made.

Description

This PR adds a missing TextAreaControl within the custom block editorFields configuration.

Related Issue(s):

#1895

Testing

  1. Inside the /example/next/block-support package add the following fields in the block-b Component.config that includes a control: 'textarea'
Component.config = {
  name: 'CreateBlockBlockB',
  editorFields: {
    message: {
      type: 'string',
      label: 'My Message',
      location: 'editor',
    },
    textArea: {
      type: 'string',
      label: 'My Message',
      location: 'editor',
      control: 'textarea'
    },
  },
};

Also update the block.json to recognize the new attribute

"attributes": {
		"message": {
			"type": "string",
			"default": "Hello World"
		},
		"textArea": {
			"type": "string",
			"default": "Hello World"
		},
  1. Build and push the blocks to WordPress:
$ npm run blockset -w examples/next/block-support 
  1. Inside the block editor you should be able to view the textArea field rendered as textarea control instead of being empty.

Screenshots

Screenshot 2024-05-30 at 16 35 12

Documentation Changes

Dependant PRs

Copy link

changeset-bot bot commented May 30, 2024

🦋 Changeset detected

Latest commit: 6b48c58

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@faustwp/block-editor-utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

📦 Next.js Bundle Analysis for @faustwp/getting-started-example

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@theodesp theodesp marked this pull request as ready for review May 31, 2024 08:52
@theodesp theodesp requested a review from a team as a code owner May 31, 2024 08:52
Copy link
Member

@ChrisWiegman ChrisWiegman left a comment

Choose a reason for hiding this comment

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

LGTM

@theodesp theodesp merged commit f0543e0 into canary Jun 5, 2024
18 checks passed
@theodesp theodesp deleted the bug-add-missing-textarea-control-handler branch June 5, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants