fix(select): value is selected when given array (#24687)

Resolves #24742
This commit is contained in:
Adam Duren
2022-02-08 21:56:48 -06:00
committed by GitHub
parent 59bbd52e35
commit 6ee7d159ec
3 changed files with 112 additions and 3 deletions

View File

@ -248,7 +248,7 @@ export class Select implements ComponentInterface {
const optClass = `${OPTION_CLASS} ${copyClasses}`;
return {
role: (isOptionSelected(value, selectValue, this.compareWith) ? 'selected' : ''),
role: (isOptionSelected(selectValue, value, this.compareWith) ? 'selected' : ''),
text: option.textContent,
cssClass: optClass,
handler: () => {
@ -282,7 +282,7 @@ export class Select implements ComponentInterface {
cssClass: optClass,
label: option.textContent || '',
value,
checked: isOptionSelected(value, selectValue, this.compareWith),
checked: isOptionSelected(selectValue, value, this.compareWith),
disabled: option.disabled
};
});
@ -302,7 +302,7 @@ export class Select implements ComponentInterface {
text: option.textContent || '',
cssClass: optClass,
value,
checked: isOptionSelected(value, selectValue, this.compareWith),
checked: isOptionSelected(selectValue, value, this.compareWith),
disabled: option.disabled,
handler: (selected: any) => {
this.value = selected;