iamstevendao / vue-tel-input

International Telephone Input with Vue
https://iamstevendao.com/vue-tel-input/
MIT License
818 stars 342 forks source link

fix: prevent infinite loop in parsedMode calculation #463

Closed jdbacero closed 6 months ago

jdbacero commented 6 months ago

Fix for #462 (and potentially #452)

Issue in version >9 where if prop mode set to auto would be unable to change/edit the phone number input after the phone number has been formatted due to a bug in a compute value of parsedMode that leads to an endless changing of value of the phoneObject which would then change the parsedMode return value, which would then change the value of phoneObject, etc etc.

The main culprit of this seems to be of how an if condition is being handled making parsedMode return the inappropriate value when result?.format(toUpperCase(parsedMode.value)) is being executed.

iamstevendao commented 6 months ago

thanks @jdbacero for your help!. just put here for visibility, it's a regression of https://github.com/iamstevendao/vue-tel-input/pull/446

image