jackocnr / intl-tel-input

A JavaScript plugin for entering and validating international telephone numbers. React and Vue components also included.
https://intl-tel-input.com
MIT License
7.69k stars 1.95k forks source link

Fix/hidden fields #1847

Closed rashadmehtab closed 1 month ago

rashadmehtab commented 1 month ago

This pull request addresses issue #1843, which indicates that hidden fields should not be added if they already exist in the DOM.

Changes Made:

This update ensures that hidden fields like <input type="hidden" name="phone_full"> and <input type="hidden" name="country_code"> are only created if they do not already exist. This effectively prevents duplication and potential data conflicts.

Additional Notes:

I welcome your feedback on these changes!

jackocnr commented 1 month ago

Thanks for putting this together. You seem to have included the translations commit in the PR - can you remove that please, else it will get duplicated when we merge both PRs. And please can you run the build JS script - npm run build:js - and commit the build files as well. See Contributing guidelines for more info.

rashadmehtab commented 1 month ago

when I run npm run build:js and I getting this below errors:

D:\repos\intl-tel-input>npm run build:js

intl-tel-input@24.6.0 build:js grunt js

Running "shell:eslint" (shell) task

D:\repos\intl-tel-input\react\src\intl-tel-input.ts 1:0 error Parsing error: Declaration or statement expected

D:\repos\intl-tel-input\react\src\intl-tel-input\data.ts 1:0 error Parsing error: Declaration or statement expected

D:\repos\intl-tel-input\react\src\intl-tel-input\intlTelInputWithUtils.ts 1:0 error Parsing error: Declaration or statement expected

D:\repos\intl-tel-input\vue\src\intl-tel-input.ts 1:0 error Parsing error: Declaration or statement expected

D:\repos\intl-tel-input\vue\src\intl-tel-input\data.ts 1:0 error Parsing error: Declaration or statement expected

D:\repos\intl-tel-input\vue\src\intl-tel-input\intlTelInputWithUtils.ts 1:0 error Parsing error: Declaration or statement expected

✖ 6 problems (6 errors, 0 warnings)

Warning: Command failed: eslint . Use --force to continue.

Aborted due to warnings.

Execution Time (2024-10-17 16:01:06 UTC+4) loading tasks 295ms ████████ 7% shell:eslint 3.9s ████████████████████████████████████████████████████████████████████████████████████████████████████████████ 93% Total 4.2s