Bugfix: AskPopupView tabbing failed now with input fields

This commit is contained in:
the-djmaze 2022-08-04 15:27:26 +02:00
parent aff9ba29e7
commit 639098f401
2 changed files with 13 additions and 5 deletions

View file

@ -5,4 +5,9 @@
padding: 3em 15px;
text-align: center;
}
button:focus {
box-shadow: 0 0 1px inset;
}
}

View file

@ -69,12 +69,15 @@ export class AskPopupView extends AbstractViewPopup {
onBuild() {
// shortcuts.add('tab', 'shift', 'Ask', () => {
shortcuts.add('tab,arrowright,arrowleft', '', 'Ask', () => {
let btn = this.querySelector('.buttonYes');
if (btn.matches(':focus')) {
btn = this.querySelector('.buttonNo');
let yes = this.querySelector('.buttonYes'),
no = this.querySelector('.buttonNo');
if (yes.matches(':focus')) {
no.focus();
return false;
} else if (no.matches(':focus')) {
yes.focus();
return false;
}
btn.focus();
return false;
});
}
}