intl-tel-input
intl-tel-input copied to clipboard
Hidden fields should not be added if existing already
Plugin version
v24.6.0
Steps to reproduce
- set hiddenInput: () => ({ phone: "phone_full", country: "phone_country" })`
- provide these hidden inputs yourself in the form (there are advantages for certain scripting like referencing these before the library creates them dynamically)
Expected behaviour
- library does not add hidden inputs a 2nd time, because we already set them up
Actual behaviour
valueof above inputs gets correctly set- but additional hidden inputs are being added
Initialisation options
intlTelInput(input, {
hiddenInput: () => ({ phone: "phone_full", country: "phone_country" }),
loadUtilsOnInit: () => import("intl-tel-input/utils"),
});
I'm onboard with this idea. We just need to check if the hidden inputs already exist (within the form) before creating them.
I don't have time to implement this myself right now, but I would welcome a pull request.
Released in v25.0.1