Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to force validation (even if the user don't focus the field) ? #175

Open
ndc-nky opened this issue Jan 14, 2022 · 2 comments
Open

How to force validation (even if the user don't focus the field) ? #175

ndc-nky opened this issue Jan 14, 2022 · 2 comments

Comments

@ndc-nky
Copy link

ndc-nky commented Jan 14, 2022

Hello,

How to force validation (even if the user don't focus the field) ?

Thank you,

Nicolas

@ndc-nky
Copy link
Author

ndc-nky commented Jan 26, 2022

up?

@a2exfr
Copy link

a2exfr commented Oct 24, 2024

I was needed to update this input from another component (virtual keyboard). And to force it to validate and resend new value - doing it like so


<VuePhoneNumberInput
				ref="phoneinput"
				v-model="phone"
				:default-country-code="defautCountry"

		/>

somewhere

			this.phone = newvalue
			const countryCode = this.$refs.phoneinput.results.countryCode
			this.$refs.phoneinput.emitValues({
				countryCode: countryCode || this.defautCountry,
				phoneNumber: newvalue,
			})

may be it will be useful for somebody

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants