[Backport to release/10.8] Fix WooPayments onboarding business type dropdown crash#65345
Conversation
Fix WooPayments onboarding select crash
Testing GuidelinesHi @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:
|
|
Size Change: -97 B (0%) Total Size: 6.23 MB
|
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. 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. |
dmallory42
left a comment
There was a problem hiding this comment.
Confirming these changes look good and match those made on the PR.

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
itemsfrom Downshift's internalaction.props. That worked with the previously resolved Downshift version, but Downshift 9.3.2 no longer includespropson 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:
Testing that has already taken place:
cd plugins/woocommerce/client/admin && pnpm test:js -- client/settings-payments/onboarding/providers/woopayments/components/custom-select-control/test/index.test.tsxcd 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,tsxpnpm --filter=@woocommerce/admin-library buildpnpm --filter=@woocommerce/plugin-woocommerce build:project:copy-assets:adminhttp://localhost:8082using Chrome:Companyand confirmed the next business structure field appeared.ArrowUp+Enter) and confirmed the selected value persisted asIndividualwith the expected next field.Milestone
Automatically assign milestone for the next WooCommerce versionChangelog 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)