From b4c9efde9e74b433af10cd100217b5fcd3b7d529 Mon Sep 17 00:00:00 2001 From: Vigneshkumar Chinnachamy M Date: Fri, 24 Apr 2020 21:35:41 +0530 Subject: [PATCH] fix business phone validation and clipped text issue in country selection --- src/components/Select/Select.scss | 1 + .../profile/components/ProfileSettingsForm.jsx | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/Select/Select.scss b/src/components/Select/Select.scss index f165bb4d4..da01936cf 100644 --- a/src/components/Select/Select.scss +++ b/src/components/Select/Select.scss @@ -4,6 +4,7 @@ $reactselectheight : 40px; $reactselectcontentheight: 20px; @mixin reactselectstyles { + line-height: normal; &.height-auto .react-select__control{ height: auto; diff --git a/src/routes/settings/routes/profile/components/ProfileSettingsForm.jsx b/src/routes/settings/routes/profile/components/ProfileSettingsForm.jsx index b61a89682..301deaeeb 100644 --- a/src/routes/settings/routes/profile/components/ProfileSettingsForm.jsx +++ b/src/routes/settings/routes/profile/components/ProfileSettingsForm.jsx @@ -67,7 +67,7 @@ class ProfileSettingsForm extends Component { } } - onBusinessPhoneCountryChange({ country, externalChange, isValid }) { + onBusinessPhoneCountryChange({ country, externalChange, isValid: isValidForApi }) { const { countrySelected: previousSelectedCountry } = this.state if (country && country.code) { @@ -78,14 +78,14 @@ class ProfileSettingsForm extends Component { countrySelected: country.name, }) } - if (!this.state.businessPhoneValid && isValid) { - this.setState({ - businessPhoneValid: true, - }) - } } - if (this.state.businessPhoneValid && !isValid) { + const isValid = isValidForApi && country && country.code + if (!this.state.businessPhoneValid && isValid) { + this.setState({ + businessPhoneValid: true, + }) + } else if (this.state.businessPhoneValid && !isValid) { this.setState({ businessPhoneValid: false, })