Skip to content

Commit bb2150d

Browse files
fix: phone field dropdown bugs
1 parent ff0e5d6 commit bb2150d

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"flickity": "^3.0.0",
4040
"formik": "^2.4.6",
4141
"fuse.js": "^6.6.2",
42-
"intl-tel-input": "17.0.21",
42+
"intl-tel-input": "24.3.5",
4343
"leaflet": "1.9.4",
4444
"lottie-web": "^5.13.0",
4545
"postcss": "8.5.6",

postcss.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ let config = {
2323
"node_modules/flickity/dist/flickity.pkgd.min.js",
2424
"node_modules/leaflet/dist/leaflet.js",
2525
"node_modules/venobox/dist/venobox.min.js",
26-
"node_modules/vanilla-framework/templates/_macros/*.jinja"
26+
"node_modules/vanilla-framework/templates/_macros/*.jinja",
27+
"node_modules/intl-tel-input/build/js/utils.js"
2728
],
2829
defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || [],
2930
safelist: {

static/js/prepare-form-inputs.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ function preFormatCountry(countryCode, countryInput, noPreselect) {
5656
* @param {HTMLInputElement} phoneInput - The input element for the phone number.
5757
*/
5858
export function setupIntlTelInput(countryCode, phoneInput) {
59+
const inputName = phoneInput.name;
5960
iti = intlTelInput(phoneInput, {
6061
utilsScript: "/static/js/modules/intl-tel-input/utils.js",
6162
separateDialCode: true,
62-
hiddenInput: phoneInput.name,
63+
hiddenInput: () => ({ phone: inputName, country: `${inputName}_country` }),
6364
initialCountry: countryCode,
6465
});
6566

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3191,10 +3191,10 @@ internal-slot@^1.1.0:
31913191
hasown "^2.0.2"
31923192
side-channel "^1.1.0"
31933193

3194-
intl-tel-input@17.0.21:
3195-
version "17.0.21"
3196-
resolved "https://registry.npmjs.org/intl-tel-input/-/intl-tel-input-17.0.21.tgz"
3197-
integrity sha512-TfyPxLe41QZPOf6RqBxRE2dpQ0FThB/PBD/gRbxVhGW7IuYg30QD90x/vjmEo4vkZw7j8etxpVcjIZVRcG+Otw==
3194+
intl-tel-input@24.3.5:
3195+
version "24.3.5"
3196+
resolved "https://registry.yarnpkg.com/intl-tel-input/-/intl-tel-input-24.3.5.tgz#cccf416a5a8a4c6b998beaef13e182402e9123ef"
3197+
integrity sha512-GBKgq1c4rx+4eq7CkKxoKC00Jd/27U/hGno+1jTlQimfxa6TBzEEpeMUJd/AG1CYu9U9I2gnAsm1wDh/3Hw9og==
31983198

31993199
ip-address@^10.0.1:
32003200
version "10.1.0"

0 commit comments

Comments
 (0)