Bug 1841200 - Toggle tree expansion with Enter. r=aleca
Differential Revision: https://phabricator.services.mozilla.com/D182708 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
a6a33502c1
Коммит
36670a6b8a
|
@ -198,6 +198,18 @@
|
|||
}
|
||||
break;
|
||||
}
|
||||
case "Enter": {
|
||||
const selected = this.selectedRow;
|
||||
if (!selected?.classList.contains("children")) {
|
||||
return;
|
||||
}
|
||||
if (selected.classList.contains("collapsed")) {
|
||||
this.expandRow(selected);
|
||||
} else {
|
||||
this.collapseRow(selected);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -649,6 +649,17 @@ async function subtestExpandCollapse() {
|
|||
checkRowsAreHidden();
|
||||
checkSelected(6, "row-3-1-1");
|
||||
|
||||
// Toggle expansion of row 3-1 with Enter key.
|
||||
|
||||
list.selectedIndex = 5;
|
||||
pressKey("row-3-1", "KEY_Enter", "collapsed");
|
||||
checkRowsAreHidden("row-3-1-1", "row-3-1-2");
|
||||
checkSelected(5, "row-3-1");
|
||||
|
||||
pressKey("row-3-1", "KEY_Enter", "expanded");
|
||||
checkRowsAreHidden();
|
||||
checkSelected(5, "row-3-1");
|
||||
|
||||
// Same again, with a RTL tree.
|
||||
|
||||
info("switching to RTL");
|
||||
|
|
Загрузка…
Ссылка в новой задаче