phone number widget fixes

This commit is contained in:
or-else
2023-01-25 18:41:19 -08:00
parent e2f3201ddb
commit 6c36324ed4
16 changed files with 35 additions and 26 deletions
+2 -5
View File
@@ -60,7 +60,6 @@ class PhoneEdit extends React.PureComponent {
showCountrySelector() {
this.props.onShowCountrySelector(this.state.countryCode, this.state.dialCode,
(code, dial) => {
console.log('Callback', code, dial);
this.setState({
countryCode: code,
dialCode: dial,
@@ -80,13 +79,11 @@ class PhoneEdit extends React.PureComponent {
}
placeholderNumber(code, dial) {
console.log('In nplaceholder', code, dial);
const number = getExampleNumber(code, examples).formatInternational();
return number.substring(dial.length + 1).trim();
const sample = getExampleNumber(code, examples);
return sample ? sample.formatInternational().substring(dial.length + 1).trim() : '123 456';
}
render() {
console.log('placeholder:', this.state.placeholderNumber);
return (
<>
<span className="dial-code" onClick={this.showCountrySelector}>