Skip to content

Commit 294425b

Browse files
authored
Merge pull request #3961 from vigneshTheDev/fix-business-phone-validation
fix business phone validation and clipped text issue in country selection #3833.
2 parents 7f915c2 + b4c9efd commit 294425b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/components/Select/Select.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
$reactselectheight : 40px;
55
$reactselectcontentheight: 20px;
66
@mixin reactselectstyles {
7+
line-height: normal;
78

89
&.height-auto .react-select__control{
910
height: auto;

src/routes/settings/routes/profile/components/ProfileSettingsForm.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class ProfileSettingsForm extends Component {
6767
}
6868
}
6969

70-
onBusinessPhoneCountryChange({ country, externalChange, isValid }) {
70+
onBusinessPhoneCountryChange({ country, externalChange, isValid: isValidForApi }) {
7171
const { countrySelected: previousSelectedCountry } = this.state
7272

7373
if (country && country.code) {
@@ -78,14 +78,14 @@ class ProfileSettingsForm extends Component {
7878
countrySelected: country.name,
7979
})
8080
}
81-
if (!this.state.businessPhoneValid && isValid) {
82-
this.setState({
83-
businessPhoneValid: true,
84-
})
85-
}
8681
}
8782

88-
if (this.state.businessPhoneValid && !isValid) {
83+
const isValid = isValidForApi && country && country.code
84+
if (!this.state.businessPhoneValid && isValid) {
85+
this.setState({
86+
businessPhoneValid: true,
87+
})
88+
} else if (this.state.businessPhoneValid && !isValid) {
8989
this.setState({
9090
businessPhoneValid: false,
9191
})

0 commit comments

Comments
 (0)