Skip to content

Forms: Fix dropdown field option background color - #43848

Merged
simison merged 3 commits into
trunkfrom
fix/dropdown-field-option-background-color
Jun 9, 2025
Merged

simison merged 3 commits into
trunkfrom
fix/dropdown-field-option-background-color

Conversation

@talldan

@talldan talldan commented Jun 9, 2025 •

Copy link
Copy Markdown
Contributor

Fixes FORMS-134

I think this problem was introduced in #43674. To fix that issue an extra wrapper was added around the <select> element, and all the dropdown field styles were applied to this wrapper.

To make the <select> element not obscure those styles its background was set to transparent.

On Windows, the native select element can have a background color applied through CSS, but that change meant it was always white and could have contrast issues with light text colors.

This change ensure that the background color is inherited by the select element so that the user specified colors also apply to the Windows native select UI element.

Border radius is also inherited, otherwise the select element's background might overlap its parent element's border.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

p1749282002478399-slack-C086RGTJT1D

Does this pull request change what data or activity we track or use?

No

Testing instructions:

  1. Create a form
  2. Add a dropdown field to the form
  3. Add some options to the dropdown field
  4. Apply a dark background and white (or light) text color to the dropdown
  5. Preview the post
  6. Click on the dropdown and check that the options are readable

@talldan talldan self-assigned this Jun 9, 2025
@talldan talldan added Bug When a feature is broken and / or not performing as intended [Feature] Forms [Status] Needs Review This PR is ready for review. [Block] Form Form block (also see Form package label) [Package] Forms [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. Bug labels Jun 9, 2025
@talldan
talldan requested review from a team June 9, 2025 09:39
@github-actions

github-actions Bot commented Jun 9, 2025 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the fix/dropdown-field-option-background-color branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/dropdown-field-option-background-color

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Jun 9, 2025
@github-actions

github-actions Bot commented Jun 9, 2025 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: July 1, 2025
    • Code freeze: June 30, 2025

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

@simison simison left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code looks good, and I trust your testing on Windows.

I tested Chrome, Firefox and Safari + Android:

Screenshot 2025-06-09 at 12 56 51 Screenshot 2025-06-09 at 12 56 55 Screenshot 2025-06-09 at 12 56 59 Screenshot 2025-06-09 at 12 56 59

And they all look good. Tested adding background and text color, and border radius, and everything continued to work.

@simison
simison merged commit 9fe4a01 into trunk Jun 9, 2025
@simison
simison deleted the fix/dropdown-field-option-background-color branch June 9, 2025 10:04
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label Jun 9, 2025
@github-actions github-actions Bot added this to the jetpack/14.8 milestone Jun 9, 2025
@ramonjd

ramonjd commented Jun 9, 2025

Copy link
Copy Markdown
Member

Thanks for fixing this!

mikestottuk pushed a commit that referenced this pull request Jun 26, 2025
* Ensure dropdown field native dropdown UI element receives background color on windows
* Also inherit border radius so that the select element doesn't overlap or cut into the wrapper element's border
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Form Form block (also see Form package label) Bug When a feature is broken and / or not performing as intended [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. [Feature] Forms [Package] Forms [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants