Skip to content

Commit

Permalink
The selected country flag should not be a button if allowDropdown is …
Browse files Browse the repository at this point in the history
…false
  • Loading branch information
ehynds authored and jackocnr committed Jul 11, 2024
1 parent 91fab06 commit 6ebbc02
Show file tree
Hide file tree
Showing 12 changed files with 216 additions and 156 deletions.
36 changes: 21 additions & 15 deletions build/js/intlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1699,33 +1699,39 @@ var factoryOutput = (() => {
{ class: "iti__country-container" },
wrapper
);
this.selectedCountry = createEl(
"button",
{
type: "button",
class: "iti__selected-country",
...allowDropdown && {
if (allowDropdown) {
this.selectedCountry = createEl(
"button",
{
type: "button",
class: "iti__selected-country",
"aria-expanded": "false",
"aria-label": this.options.i18n.selectedCountryAriaLabel,
"aria-haspopup": "true",
"aria-controls": `iti-${this.id}__dropdown-content`,
"role": "combobox"
}
},
this.countryContainer
);
},
this.countryContainer
);
if (this.telInput.disabled) {
this.selectedCountry.setAttribute("aria-disabled", "true");
} else {
this.selectedCountry.setAttribute("tabindex", "0");
}
} else {
this.selectedCountry = createEl(
"div",
{ class: "iti__selected-country" },
this.countryContainer
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
this.selectedCountryInner
);
if (this.telInput.disabled) {
this.selectedCountry.setAttribute("aria-disabled", "true");
} else {
this.selectedCountry.setAttribute("tabindex", "0");
}
if (allowDropdown) {
this.dropdownArrow = createEl(
"div",
Expand Down
2 changes: 1 addition & 1 deletion build/js/intlTelInput.min.js

Large diffs are not rendered by default.

36 changes: 21 additions & 15 deletions build/js/intlTelInputWithUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1698,33 +1698,39 @@ var factoryOutput = (() => {
{ class: "iti__country-container" },
wrapper
);
this.selectedCountry = createEl(
"button",
{
type: "button",
class: "iti__selected-country",
...allowDropdown && {
if (allowDropdown) {
this.selectedCountry = createEl(
"button",
{
type: "button",
class: "iti__selected-country",
"aria-expanded": "false",
"aria-label": this.options.i18n.selectedCountryAriaLabel,
"aria-haspopup": "true",
"aria-controls": `iti-${this.id}__dropdown-content`,
"role": "combobox"
}
},
this.countryContainer
);
},
this.countryContainer
);
if (this.telInput.disabled) {
this.selectedCountry.setAttribute("aria-disabled", "true");
} else {
this.selectedCountry.setAttribute("tabindex", "0");
}
} else {
this.selectedCountry = createEl(
"div",
{ class: "iti__selected-country" },
this.countryContainer
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
this.selectedCountryInner
);
if (this.telInput.disabled) {
this.selectedCountry.setAttribute("aria-disabled", "true");
} else {
this.selectedCountry.setAttribute("tabindex", "0");
}
if (allowDropdown) {
this.dropdownArrow = createEl(
"div",
Expand Down
2 changes: 1 addition & 1 deletion build/js/intlTelInputWithUtils.min.js

Large diffs are not rendered by default.

36 changes: 21 additions & 15 deletions react/build/IntlTelInput.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1694,33 +1694,39 @@ var Iti = class {
{ class: "iti__country-container" },
wrapper
);
this.selectedCountry = createEl(
"button",
{
type: "button",
class: "iti__selected-country",
...allowDropdown && {
if (allowDropdown) {
this.selectedCountry = createEl(
"button",
{
type: "button",
class: "iti__selected-country",
"aria-expanded": "false",
"aria-label": this.options.i18n.selectedCountryAriaLabel,
"aria-haspopup": "true",
"aria-controls": `iti-${this.id}__dropdown-content`,
"role": "combobox"
}
},
this.countryContainer
);
},
this.countryContainer
);
if (this.telInput.disabled) {
this.selectedCountry.setAttribute("aria-disabled", "true");
} else {
this.selectedCountry.setAttribute("tabindex", "0");
}
} else {
this.selectedCountry = createEl(
"div",
{ class: "iti__selected-country" },
this.countryContainer
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
this.selectedCountryInner
);
if (this.telInput.disabled) {
this.selectedCountry.setAttribute("aria-disabled", "true");
} else {
this.selectedCountry.setAttribute("tabindex", "0");
}
if (allowDropdown) {
this.dropdownArrow = createEl(
"div",
Expand Down
36 changes: 21 additions & 15 deletions react/build/IntlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1658,33 +1658,39 @@ var Iti = class {
{ class: "iti__country-container" },
wrapper
);
this.selectedCountry = createEl(
"button",
{
type: "button",
class: "iti__selected-country",
...allowDropdown && {
if (allowDropdown) {
this.selectedCountry = createEl(
"button",
{
type: "button",
class: "iti__selected-country",
"aria-expanded": "false",
"aria-label": this.options.i18n.selectedCountryAriaLabel,
"aria-haspopup": "true",
"aria-controls": `iti-${this.id}__dropdown-content`,
"role": "combobox"
}
},
this.countryContainer
);
},
this.countryContainer
);
if (this.telInput.disabled) {
this.selectedCountry.setAttribute("aria-disabled", "true");
} else {
this.selectedCountry.setAttribute("tabindex", "0");
}
} else {
this.selectedCountry = createEl(
"div",
{ class: "iti__selected-country" },
this.countryContainer
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
this.selectedCountryInner
);
if (this.telInput.disabled) {
this.selectedCountry.setAttribute("aria-disabled", "true");
} else {
this.selectedCountry.setAttribute("tabindex", "0");
}
if (allowDropdown) {
this.dropdownArrow = createEl(
"div",
Expand Down
36 changes: 21 additions & 15 deletions react/build/IntlTelInputWithUtils.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1694,33 +1694,39 @@ var Iti = class {
{ class: "iti__country-container" },
wrapper
);
this.selectedCountry = createEl(
"button",
{
type: "button",
class: "iti__selected-country",
...allowDropdown && {
if (allowDropdown) {
this.selectedCountry = createEl(
"button",
{
type: "button",
class: "iti__selected-country",
"aria-expanded": "false",
"aria-label": this.options.i18n.selectedCountryAriaLabel,
"aria-haspopup": "true",
"aria-controls": `iti-${this.id}__dropdown-content`,
"role": "combobox"
}
},
this.countryContainer
);
},
this.countryContainer
);
if (this.telInput.disabled) {
this.selectedCountry.setAttribute("aria-disabled", "true");
} else {
this.selectedCountry.setAttribute("tabindex", "0");
}
} else {
this.selectedCountry = createEl(
"div",
{ class: "iti__selected-country" },
this.countryContainer
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
this.selectedCountryInner
);
if (this.telInput.disabled) {
this.selectedCountry.setAttribute("aria-disabled", "true");
} else {
this.selectedCountry.setAttribute("tabindex", "0");
}
if (allowDropdown) {
this.dropdownArrow = createEl(
"div",
Expand Down
36 changes: 21 additions & 15 deletions react/build/IntlTelInputWithUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1658,33 +1658,39 @@ var Iti = class {
{ class: "iti__country-container" },
wrapper
);
this.selectedCountry = createEl(
"button",
{
type: "button",
class: "iti__selected-country",
...allowDropdown && {
if (allowDropdown) {
this.selectedCountry = createEl(
"button",
{
type: "button",
class: "iti__selected-country",
"aria-expanded": "false",
"aria-label": this.options.i18n.selectedCountryAriaLabel,
"aria-haspopup": "true",
"aria-controls": `iti-${this.id}__dropdown-content`,
"role": "combobox"
}
},
this.countryContainer
);
},
this.countryContainer
);
if (this.telInput.disabled) {
this.selectedCountry.setAttribute("aria-disabled", "true");
} else {
this.selectedCountry.setAttribute("tabindex", "0");
}
} else {
this.selectedCountry = createEl(
"div",
{ class: "iti__selected-country" },
this.countryContainer
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
this.selectedCountryInner
);
if (this.telInput.disabled) {
this.selectedCountry.setAttribute("aria-disabled", "true");
} else {
this.selectedCountry.setAttribute("tabindex", "0");
}
if (allowDropdown) {
this.dropdownArrow = createEl(
"div",
Expand Down
36 changes: 21 additions & 15 deletions react/demo/set-number-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25187,33 +25187,39 @@
{ class: "iti__country-container" },
wrapper
);
this.selectedCountry = createEl(
"button",
{
type: "button",
class: "iti__selected-country",
...allowDropdown && {
if (allowDropdown) {
this.selectedCountry = createEl(
"button",
{
type: "button",
class: "iti__selected-country",
"aria-expanded": "false",
"aria-label": this.options.i18n.selectedCountryAriaLabel,
"aria-haspopup": "true",
"aria-controls": `iti-${this.id}__dropdown-content`,
"role": "combobox"
}
},
this.countryContainer
);
},
this.countryContainer
);
if (this.telInput.disabled) {
this.selectedCountry.setAttribute("aria-disabled", "true");
} else {
this.selectedCountry.setAttribute("tabindex", "0");
}
} else {
this.selectedCountry = createEl(
"div",
{ class: "iti__selected-country" },
this.countryContainer
);
}
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
this.selectedCountryInner = createEl("div", null, selectedCountryPrimary);
this.selectedCountryA11yText = createEl(
"span",
{ class: "iti__a11y-text" },
this.selectedCountryInner
);
if (this.telInput.disabled) {
this.selectedCountry.setAttribute("aria-disabled", "true");
} else {
this.selectedCountry.setAttribute("tabindex", "0");
}
if (allowDropdown) {
this.dropdownArrow = createEl(
"div",
Expand Down
Loading

0 comments on commit 6ebbc02

Please sign in to comment.