Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Hidden fields should not be added if existing already #1843

Open
larsblumberg opened this issue Oct 12, 2024 · 1 comment
Open

Hidden fields should not be added if existing already #1843

larsblumberg opened this issue Oct 12, 2024 · 1 comment

Comments

@larsblumberg
Copy link

larsblumberg commented Oct 12, 2024

Plugin version

v24.6.0

Steps to reproduce

  1. set hiddenInput: () => ({ phone: "phone_full", country: "phone_country" })`
  2. 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

  • value of above inputs gets correctly set
  • but additional hidden inputs are being added

image

Initialisation options

  intlTelInput(input, {
    hiddenInput: () => ({ phone: "phone_full", country: "phone_country" }),
    loadUtilsOnInit: () => import("intl-tel-input/utils"),
  });
@jackocnr
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants