mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-08-14 12:50:37 +03:00
Fix alt + arrows navigation
This commit is contained in:
parent
545bd97570
commit
49179dd806
|
@ -107,7 +107,22 @@ function RSTabs() {
|
|||
[router, schema, activeTab, version]
|
||||
);
|
||||
|
||||
function onSelectTab(index: number) {
|
||||
function onSelectTab(index: number, last: number, event: Event) {
|
||||
if (last === index) {
|
||||
return;
|
||||
}
|
||||
if (event.type == 'keydown') {
|
||||
const kbEvent = event as KeyboardEvent;
|
||||
if (kbEvent.altKey) {
|
||||
if (kbEvent.code === 'ArrowLeft') {
|
||||
router.back();
|
||||
return;
|
||||
} else if (kbEvent.code === 'ArrowRight') {
|
||||
router.forward();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
navigateTab(index, selected.length > 0 ? selected.at(-1) : undefined);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user