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

Components: Do not render FormTokenField label when not defined #61336

Merged
merged 8 commits into from
May 8, 2024

Conversation

retrofox
Copy link
Contributor

@retrofox retrofox commented May 2, 2024

What?

Changes introduced this PR doesn't not rendering the label elements when the property value is not defined

Why?

Because currently, the component renders element with empty content

How?

It will render the label components only when the property is defined

Testing Instructions

Using storybook

  1. Run storybook locally
npm run storybook:dev
  1. Select the default story for the TokenFormField component

http://localhost:50240/?path=/story/components-formtokenfield--default&args=label:

  1. Confirm that when the label is empty or not defined, now the component does not add an additional empty space
before (trunk) after (this PR)
Screenshot 2024-05-02 at 19 46 16 Screenshot 2024-05-02 at 19 43 42
  1. You can confirm that currently (trunk) the component renders en empty label attribute
image

Testing Instructions for Keyboard

Screenshots or screencast

@retrofox retrofox added the [Package] Components /packages/components label May 2, 2024
@retrofox retrofox requested review from mirka and torounit May 2, 2024 18:48
@retrofox retrofox self-assigned this May 2, 2024
@retrofox retrofox marked this pull request as ready for review May 2, 2024 18:48
@retrofox retrofox requested a review from ajitbohra as a code owner May 2, 2024 18:48
Copy link

github-actions bot commented May 2, 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.

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

Co-authored-by: retrofox <retrofox@git.wordpress.org>
Co-authored-by: alexstine <alexstine@git.wordpress.org>

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

@retrofox retrofox changed the title Components: Do not label of FormTokenField when not defined May 2, 2024
Copy link
Contributor

@alexstine alexstine left a comment

Choose a reason for hiding this comment

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

@retrofox Looks good. Do not forget to add a components changelog entry and then this is ready to merge given checks pass.

@retrofox retrofox force-pushed the update/form-token-field-null-label branch from b620926 to dc0bf33 Compare May 6, 2024 07:43
@retrofox retrofox linked an issue May 6, 2024 that may be closed by this pull request
@retrofox retrofox force-pushed the update/form-token-field-null-label branch 2 times, most recently from 7a1b734 to 6e40825 Compare May 6, 2024 08:14
@retrofox retrofox force-pushed the update/form-token-field-null-label branch from 6e40825 to 7674066 Compare May 6, 2024 08:18
@retrofox
Copy link
Contributor Author

retrofox commented May 6, 2024

@retrofox Looks good.

👍

Do not forget to add a components changelog entry and then this is ready to merge given checks pass.

I've added the entry, but the test still fails :-(

Please add a CHANGELOG entry to packages/components/CHANGELOG.md,
and make sure your CHANGELOG entry has a link to the current PR.
Copy link

github-actions bot commented May 6, 2024

Flaky tests detected in 64a42b4.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8981159903
📝 Reported issues:

@alexstine
Copy link
Contributor

@retrofox Just pushed a commit, let's see if that makes them pass.

@retrofox
Copy link
Contributor Author

retrofox commented May 8, 2024

Thanks 🙇‍♂️

@retrofox retrofox merged commit 60d2269 into trunk May 8, 2024
62 checks passed
@retrofox retrofox deleted the update/form-token-field-null-label branch May 8, 2024 06:28
@github-actions github-actions bot added this to the Gutenberg 18.4 milestone May 8, 2024
@Mamaduka Mamaduka added the [Type] Enhancement A suggestion for improvement. label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
3 participants