Skip to content

Commit

Permalink
Handle selection change using keyboard or a11y action
Browse files Browse the repository at this point in the history
  • Loading branch information
vinocher committed Dec 12, 2023
1 parent 492d495 commit fdf28b5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nebula/ui/components/MZTabNavigation.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ Item {
bar.setCurrentIndex(idx);
}

function handleSelection(btn){
bar.currentIndex = btn.TabBar.index;
btn.clicked();
}

Rectangle {
// grey divider
anchors.bottom: bar.bottom
Expand Down Expand Up @@ -49,7 +54,9 @@ Item {
height: bar.contentHeight
Accessible.name: MZI18n[tabLabelStringId]
Accessible.ignored: !visible
Accessible.onPressAction: handleTabClick(btn)
Accessible.onPressAction: handleSelection(btn)
Keys.onReturnPressed: handleSelection(btn)
Keys.onSpacePressed: handleSelection(btn)

onClicked: handleTabClick(btn)

Expand Down

0 comments on commit fdf28b5

Please sign in to comment.