Skip to content

Commit 5d1f68c

Browse files
authored
Merge pull request #3286 from vigneshTheDev/profile-settings-alert-fix
(fix for issue #3263) hide country selection alert on outside click in
2 parents 78bc430 + 442830d commit 5d1f68c

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ class ProfileSettingsForm extends Component {
3737
this.onChange = this.onChange.bind(this)
3838
this.onBusinessPhoneCountryChange = this.onBusinessPhoneCountryChange.bind(this)
3939
this.onCountryChange = this.onCountryChange.bind(this)
40+
41+
this.hideCountrySelectAlert = this.hideCountrySelectAlert.bind(this)
42+
this.hideBusinessPhoneAlert = this.hideBusinessPhoneAlert.bind(this)
4043
}
4144

4245
onCountryChange(country) {
@@ -82,6 +85,18 @@ class ProfileSettingsForm extends Component {
8285
}
8386
}
8487

88+
hideCountrySelectAlert() {
89+
this.setState({
90+
countrySelectionDirty: false
91+
})
92+
}
93+
94+
hideBusinessPhoneAlert () {
95+
this.setState({
96+
businessPhoneDirty: false
97+
})
98+
}
99+
85100
getField(label, name, isRequired=false) {
86101
let validations = null
87102
if (name === 'businessPhone') {
@@ -183,6 +198,7 @@ class ProfileSettingsForm extends Component {
183198
forceCountry={this.state.countrySelected}
184199
value={this.props.values.settings.businessPhone}
185200
onChangeCountry={this.onBusinessPhoneCountryChange}
201+
onOutsideClick={this.hideBusinessPhoneAlert}
186202
/>
187203
{
188204
this.state.businessPhoneDirty &&
@@ -238,6 +254,7 @@ class ProfileSettingsForm extends Component {
238254
placeholder="- Select country -"
239255
showDropdownIndicator
240256
setValueOnly
257+
onBlur={this.hideCountrySelectAlert}
241258
/>
242259
{
243260
this.state.countrySelectionDirty &&

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,12 @@
176176
margin: 5px auto;
177177
@include roboto;
178178

179-
color: $tc-gray-70;
180179
font-size: 13px;
181180
line-height:20px;
182181
font-style:italic;
183-
border: 1px solid $tc-red-30;
182+
border: 1px solid $tc-orange-30;
184183
background: $tc-red-10;
185-
color: $tc-red-70;
184+
color: $tc-orange-70;
186185
padding:10px;
187186
border-radius: 2px;
188187
}

0 commit comments

Comments
 (0)