Skip to content

Commit cb98e52

Browse files
author
edencoder
committed
amend issues with phone input
1 parent 658adf7 commit cb98e52

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

bundles/form/fields/phone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export default class PhoneField extends Field {
9292
if (!value) return value;
9393

9494
// parsed
95-
const parsed = typeof value === 'string' ? parsePhoneNumber(value, field.country || 'US') || {} : value;
95+
const parsed = typeof value === 'string' ? parsePhoneNumber(value, field.country || 'US') : parsePhoneNumber(value.number);
9696

9797
// check value
9898
const data = typeof value === 'string' ? {

bundles/form/views/field/phone/input.riot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<i>Set Label</i>
66
</a>
77
</label>
8-
<validate type="tel" help={ props.field.help } country={ props.field.country } read-only={ !props.shouldRead(props.field) } group-class={ props.field.group || 'mb-3' } name={ props.getName(props.field.uuid) } label={ props.field.label } placeholder={ props.field.placeholder } data-value={ value && value.number ? value.number : null } on-change={ props.onChange } required={ props.field.required } min-length={ get('field.validateLength.min', 0) } max-length={ get('field.validateLength.max', 1000) } on-change={ onChange }>
8+
<validate type="tel" help={ props.field.help } country={ props.field.country } read-only={ !props.shouldRead(props.field) } group-class={ props.field.group || 'mb-3' } name={ props.getName(props.field.uuid) } label={ props.field.label } placeholder={ props.field.placeholder } data-value={ value && value.number ? value.number : null } required={ props.field.required } min-length={ get('field.validateLength.min', 0) } max-length={ get('field.validateLength.max', 1000) } on-change={ onChange }>
99
<span slot="append" class="input-group-text" data-toggle="tooltip" title="Validated" if={ value && value.valid }>
1010
<i class="fa fa-check" />
1111
</span>
@@ -45,7 +45,7 @@
4545
this.default = true;
4646
4747
// set default
48-
this.$('input').value = this.props.default;
48+
this.$('input[type="hidden"]').value = this.props.default;
4949
}
5050
}
5151
@@ -59,7 +59,7 @@
5959
this.value = {
6060
...(this.value),
6161
62-
number : this.$('input').value,
62+
number : this.$('input[type="hidden"]').value,
6363
};
6464
this.default = false;
6565

0 commit comments

Comments
 (0)