Skip to content

Commit

Permalink
Focus the active tab when tabs are mounted
Browse files Browse the repository at this point in the history
  • Loading branch information
MisRob committed Mar 3, 2023
1 parent f54b5ef commit 29395f8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kolibri/plugins/coach/assets/src/views/plan/PlanHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<p>{{ $tr('planYourClassDescription') }}</p>
<HeaderTabs :style="{ marginTop: '28px' }">
<KTabsList
ref="tabsList"
:tabsId="PLAN_TABS_ID"
ariaLabel="Coach plan"
:activeTabId="activeTabId"
Expand Down Expand Up @@ -72,6 +73,12 @@
];
},
},
mounted() {
// see https://github.com/learningequality/kolibri/issues/10113
this.$nextTick(() => {
this.$refs.tabsList.focusActiveTab();
});
},
$trs: {
planYourClassLabel: {
message: 'Plan your class',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
:style="{ marginTop: '34px' }"
>
<KTabsList
ref="tabsList"
:tabsId="REPORTS_GROUP_TABS_ID"
ariaLabel="Group reports"
:activeTabId="activeTabId"
Expand Down Expand Up @@ -77,6 +78,12 @@
];
},
},
mounted() {
// see https://github.com/learningequality/kolibri/issues/10113
this.$nextTick(() => {
this.$refs.tabsList.focusActiveTab();
});
},
$trs: {
back: {
message: 'All groups',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
</p>
<HeaderTabs :style="{ marginTop: '28px' }">
<KTabsList
ref="tabsList"
:tabsId="REPORTS_TABS_ID"
ariaLabel="Coach reports"
:activeTabId="activeTabId"
Expand Down Expand Up @@ -81,6 +82,12 @@
];
},
},
mounted() {
// see https://github.com/learningequality/kolibri/issues/10113
this.$nextTick(() => {
this.$refs.tabsList.focusActiveTab();
});
},
$trs: {
description: {
message: 'View reports for your learners and class materials',
Expand Down

0 comments on commit 29395f8

Please sign in to comment.