Skip to content

Commit

Permalink
Fix: dropdown arrow jumps when geoIpLookup completes
Browse files Browse the repository at this point in the history
  • Loading branch information
jackocnr committed Aug 15, 2024
1 parent 8e0b196 commit 4bc42c6
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build/css/intlTelInput.css
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
}

.iti__flag {
--iti-flag-offset: 0px;
--iti-flag-offset: 100px;
--iti-flag-width: 20px;
--iti-flag-height: 14px;
height: var(--iti-flag-height);
Expand Down
2 changes: 1 addition & 1 deletion build/js/intlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1730,7 +1730,7 @@ var factoryOutput = (() => {
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryInner = createEl("div", { class: "iti__flag" }, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
Expand Down
2 changes: 1 addition & 1 deletion build/js/intlTelInput.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/js/intlTelInputWithUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ var factoryOutput = (() => {
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryInner = createEl("div", { class: "iti__flag" }, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
Expand Down
2 changes: 1 addition & 1 deletion build/js/intlTelInputWithUtils.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion react/build/IntlTelInput.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,7 @@ var Iti = class {
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryInner = createEl("div", { class: "iti__flag" }, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
Expand Down
2 changes: 1 addition & 1 deletion react/build/IntlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ var Iti = class {
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryInner = createEl("div", { class: "iti__flag" }, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
Expand Down
2 changes: 1 addition & 1 deletion react/build/IntlTelInputWithUtils.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,7 @@ var Iti = class {
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryInner = createEl("div", { class: "iti__flag" }, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
Expand Down
2 changes: 1 addition & 1 deletion react/build/IntlTelInputWithUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ var Iti = class {
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryInner = createEl("div", { class: "iti__flag" }, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
Expand Down
2 changes: 1 addition & 1 deletion react/demo/set-number-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25218,7 +25218,7 @@
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryInner = createEl("div", { class: "iti__flag" }, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
Expand Down
2 changes: 1 addition & 1 deletion react/demo/simple-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25218,7 +25218,7 @@
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryInner = createEl("div", { class: "iti__flag" }, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
Expand Down
2 changes: 1 addition & 1 deletion react/demo/toggle-disabled-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25218,7 +25218,7 @@
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryInner = createEl("div", { class: "iti__flag" }, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
Expand Down
2 changes: 1 addition & 1 deletion react/demo/validation-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25218,7 +25218,7 @@
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryInner = createEl("div", { class: "iti__flag" }, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
Expand Down
3 changes: 2 additions & 1 deletion src/css/intlTelInput.scss
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@
}

.iti__flag {
--iti-flag-offset: 0px;
//* Start with an offset to hide any flags. This is useful to show an empty state (with correct dimensions) while geoIpLookup is loading.
--iti-flag-offset: 100px;
--iti-flag-width: #{$most-common-flag-width};
--iti-flag-height: #{$most-common-flag-height};

Expand Down
2 changes: 1 addition & 1 deletion src/js/intl-tel-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ export class Iti {
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);

//* This is where we will add the selected flag (or globe) class later
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryInner = createEl("div", { class: "iti__flag" }, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
Expand Down

0 comments on commit 4bc42c6

Please sign in to comment.