amelioration(a11y): permet les interactions clavier via les touches entrée et espace pour ouvrir et fermer le menu depliant quand le focus est sur le bouton

This commit is contained in:
Martin 2022-12-28 16:47:00 +01:00 committed by mfo
parent 984ef67827
commit ddc04a03a4

View file

@ -154,6 +154,13 @@ export class MenuButtonController extends ApplicationController {
switch (event.key) {
case ' ':
case 'Enter':
if (this.isOpen) {
this.close();
} else {
this.open();
}
stopPropagation = true;
break;
case 'ArrowDown':
case 'Down':
this.open();