woocommerce/plugins/woocommerce-blocks/assets/js/base/components/country-input
Sam Seay 137a2e8aa6
Checkout: Add placeholder option to country and state select, add error validation (#49616)
* WIP

* Add empty option for state as well

* Add client-side validation to country select inputs

* Add validation messages for state.

* Clean up redundant destructuring.

* Fix up the validation logic, fix bug where empty select was shown in some cases.

* Remove unused import

* Use import aliases instead of large relative paths

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Fix a typo

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* use SelectOption type

* Also handle when address changes, because we shouldnt validate state when there is an address change

* adjust validation to handle any address change, not just country. translate field validations and use lowercase

* add a lowercase label for the country select as well

* Fix an issue where scroll to would not scroll to invalid select

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2024-07-24 17:59:15 +02:00
..
stories Add Notices Documentation to Storybook and upgrade to Storybook 7 (https://github.com/woocommerce/woocommerce-blocks/pull/11524) 2023-11-02 13:01:42 +00:00
CountryInputProps.ts Block-based checkout - Update address fields display logic (#47160) 2024-05-21 15:48:24 +07:00
billing-country-input.tsx Checkout: Add placeholder option to country and state select, add error validation (#49616) 2024-07-24 17:59:15 +02:00
country-input.tsx Checkout: Add placeholder option to country and state select, add error validation (#49616) 2024-07-24 17:59:15 +02:00
index.ts Storybook migration of `CountryInput` component (https://github.com/woocommerce/woocommerce-blocks/pull/5312) 2021-12-07 16:07:21 +01:00
shipping-country-input.tsx Update `AddressForm` and related components to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4365) 2021-06-17 09:35:24 +01:00
style.scss Fix styling for select in Site Editor (#45252) 2024-03-05 14:49:33 +01:00