Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Revert "Add requireExactMatch prop to ComboBox to prevent wrong c…
Browse files Browse the repository at this point in the history
…ountry/state values being sent to the server (#6426)" (#6447)

This reverts commit 5a2a979.
  • Loading branch information
opr authored May 24, 2022
1 parent e8be043 commit 40d27b7
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 67 deletions.
10 changes: 1 addition & 9 deletions assets/js/base/components/combobox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export interface ComboboxProps {
options: ComboboxControlOption[];
required?: boolean;
value: string;
requireExactMatch?: boolean;
}

/**
Expand All @@ -55,7 +54,6 @@ const Combobox = ( {
errorId: incomingErrorId,
instanceId = '0',
autoComplete = 'off',
requireExactMatch = false,
}: ComboboxProps ): JSX.Element => {
const {
getValidationError,
Expand Down Expand Up @@ -138,13 +136,7 @@ const Combobox = ( {
normalizedFilterValue
);
if ( foundOption ) {
if ( ! requireExactMatch ) {
onChange( foundOption.value );
return;
}
if ( foundOption.label === filterValue ) {
onChange( foundOption.value );
}
onChange( foundOption.value );
}
}
} }
Expand Down
56 changes: 0 additions & 56 deletions assets/js/base/components/combobox/test/index.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/js/base/components/country-input/country-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const CountryInput = ( {
errorMessage={ errorMessage }
required={ required }
autoComplete={ autoComplete }
requireExactMatch={ true }
/>
{ autoComplete !== 'off' && (
<input
Expand Down
1 change: 0 additions & 1 deletion assets/js/base/components/state-input/state-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ const StateInput = ( {
) }
required={ required }
autoComplete={ autoComplete }
requireExactMatch={ true }
/>
{ autoComplete !== 'off' && (
<input
Expand Down

0 comments on commit 40d27b7

Please sign in to comment.