Skip to content

Commit 5f608fe

Browse files
authored
Merge pull request #153 from Alexandernoa/master
Disallowed formatting a phone with the 'customValidate' property, remove unnecessary 'disabledFormatting' property
2 parents 39593ca + 660fd6e commit 5f608fe

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ Read more on `vue-form-generator`'s [instruction page](https://icebob.gitbooks.i
163163
| `defaultCountry` | `String` | `''` | Default country, will override the country fetched from IP address of user |
164164
| `disabled` | `Boolean` | `false` | Disable input field |
165165
| `disabledFetchingCountry` | `Boolean` | `false` | Disable fetching current country based on IP address of user |
166-
| `disabledFormatting` | `Boolean` | `false` | Disable formatting the phone number in the input, the formatted result still be accessible by `formattedNumber` returned from `onInput` event |
167166
| `dropdownOptions` | `Object` | `{ disabledDialCode: false, tabindex: 0 }` | Options for dropdown, supporting `disabledDialCode` and `tabindex`|
168167
| `dynamicPlaceholder` | `Boolean` | `false` | Placeholder as a sample phone number in the current country, available from [v3.1.1](https://github.com/EducationLink/vue-tel-input/releases/tag/v3.1.1) |
169168
| `enabledCountryCode` | `Boolean` | `false` | Enable country code in the input |

src/components/vue-tel-input.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@ export default {
133133
type: Boolean,
134134
default: () => getDefault('disabled'),
135135
},
136-
disabledFormatting: {
137-
type: Boolean,
138-
default: () => getDefault('disabledFormatting'),
139-
},
140136
mode: {
141137
type: String,
142138
default: () => getDefault('mode'),
@@ -252,6 +248,9 @@ export default {
252248
return this.placeholder;
253249
},
254250
parsedMode() {
251+
if (this.customValidate) {
252+
return 'input';
253+
}
255254
if (this.mode) {
256255
if (!['international', 'national'].includes(this.mode)) {
257256
console.error('Invalid value of prop "mode"');

src/utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export const defaultOptions = {
3535
placeholder: 'Enter a phone number',
3636
disabledFetchingCountry: false,
3737
disabled: false,
38-
disabledFormatting: false,
3938
mode: '',
4039
invalidMsg: '',
4140
required: false,

0 commit comments

Comments
 (0)