close
Skip to content

[Backport to release/10.8] Fix WooPayments onboarding business type dropdown crash#65345

Merged
PanosSynetos merged 1 commit into
release/10.8from
cherry-pick-PR65336-to-release/10.8
May 27, 2026
Merged

[Backport to release/10.8] Fix WooPayments onboarding business type dropdown crash#65345
PanosSynetos merged 1 commit into
release/10.8from
cherry-pick-PR65336-to-release/10.8

Conversation

@woocommercebot
Copy link
Copy Markdown
Collaborator

This PR is a cherry-pick of #65336 to release/10.8.

Original PR Description

Submission Review Guidelines:

Changes proposed in this Pull Request:

Fixes a crash in the WooPayments in-context onboarding modal on the payments settings page when opening the business type dropdown.

The copied custom select reducer was reading items from Downshift's internal action.props. That worked with the previously resolved Downshift version, but Downshift 9.3.2 no longer includes props on the reducer action. This removes the custom reducer and lets Downshift handle option highlighting and selection, avoiding reliance on changed internals and preserving keyboard navigation behavior.

Also adds focused regression tests that open the custom select menu and select an option via ArrowDown/Enter keyboard navigation. Without the fix, opening the menu fails with TypeError: (destructured parameter).props is undefined; the keyboard test guards against regressing selection behavior.

(For Bug Fixes) Bug introduced in PR #64114.

Screenshots or screen recordings:

N/A. The visual UI is unchanged.

How to test the changes in this Pull Request:

  1. Go to WooCommerce > Settings > Payments.
  2. Start or resume the WooPayments setup flow.
  3. Proceed to the Activate payments step.
  4. Click the What type of legal entity is your business? dropdown.
  5. Confirm the dropdown opens and options are shown without the modal crashing.
  6. Confirm you can change the input on the dropdown with ArrowUp/ArrowDown and Enter.
Screenshot 2026-05-27 at 14 00 25

Testing that has already taken place:

  • Ran the focused Jest regression test:
    • cd plugins/woocommerce/client/admin && pnpm test:js -- client/settings-payments/onboarding/providers/woopayments/components/custom-select-control/test/index.test.tsx
  • Ran ESLint for the changed TS/TSX files:
    • cd plugins/woocommerce/client/admin && pnpm exec eslint client/settings-payments/onboarding/providers/woopayments/components/custom-select-control/index.tsx client/settings-payments/onboarding/providers/woopayments/components/custom-select-control/test/index.test.tsx --ext=js,ts,tsx
  • Built the admin assets and copied them into the WooCommerce plugin assets:
    • pnpm --filter=@woocommerce/admin-library build
    • pnpm --filter=@woocommerce/plugin-woocommerce build:project:copy-assets:admin
  • Smoke tested locally at http://localhost:8082 using Chrome:
    • Opened WooCommerce payments settings.
    • Started the WooPayments onboarding modal.
    • Clicked the business type dropdown.
    • Confirmed the options rendered and there were no relevant console errors.
    • Selected Company and confirmed the next business structure field appeared.
    • Changed the business type with keyboard navigation (ArrowUp + Enter) and confirmed the selected value persisted as Individual with the expected next field.

Milestone

Changelog entry

Manual changelog entry added: plugins/woocommerce/changelog/fix-woopayments-onboarding-select-crash.

  • Automatically create a changelog entry from the details below.

  • This Pull Request does not require a changelog entry. (Comment required below)

@woocommercebot woocommercebot requested a review from dmallory42 May 27, 2026 13:45
@github-actions github-actions Bot added this to the 10.8.0 milestone May 27, 2026
@github-actions github-actions Bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label May 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Testing Guidelines

Hi @dmallory42 ,

Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed.

Reminder: PR reviewers are required to document testing performed. This includes:

  • 🖼️ Screenshots or screen recordings.
  • 📝 List of functionality tested / steps followed.
  • 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
  • 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.

⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.

@github-actions
Copy link
Copy Markdown
Contributor

Size Change: -97 B (0%)

Total Size: 6.23 MB

Filename Size Change
./plugins/woocommerce/client/admin/build/chunks/3132.js 15.5 kB -102 B (-0.65%)

compressed-size-action

@github-actions
Copy link
Copy Markdown
Contributor

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a commit that changes plugin code.

Copy link
Copy Markdown
Contributor

@dmallory42 dmallory42 left a comment

Choose a reason for hiding this comment

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

Confirming these changes look good and match those made on the PR.

@PanosSynetos PanosSynetos merged commit f1b4ba1 into release/10.8 May 27, 2026
52 of 55 checks passed
@PanosSynetos PanosSynetos deleted the cherry-pick-PR65336-to-release/10.8 branch May 27, 2026 14:29
@github-actions github-actions Bot added the metric: feature freeze exception A tracking label for PRs that were merged after the feature freeze. label May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

metric: feature freeze exception A tracking label for PRs that were merged after the feature freeze. plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants