fix(select): do not close popover or set value when switching with arrow keys (#22210)

fixes #22179
This commit is contained in:
Brandy Carney
2020-10-06 17:33:35 -04:00
committed by GitHub
parent 66b4d11545
commit 1878c8e7e0

View File

@@ -97,6 +97,8 @@ export class RadioGroup implements ComponentInterface {
@Listen('keydown', { target: 'document' })
onKeydown(ev: any) {
const inSelectPopover = !!this.el.closest('ion-select-popover');
if (ev.target && !this.el.contains(ev.target)) {
return;
}
@@ -129,7 +131,10 @@ export class RadioGroup implements ComponentInterface {
if (next && radios.includes(next)) {
next.setFocus();
this.value = next.value;
if (!inSelectPopover) {
this.value = next.value;
}
}
}
}