Skip to content

Commit

Permalink
fix: card details focus issue with screen reader
Browse files Browse the repository at this point in the history
Signed-off-by: Luka Trovic <luka@nextcloud.com>
  • Loading branch information
luka-nextcloud authored and juliusknorr committed May 9, 2024
1 parent 2559da6 commit f70cd2d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/card/CardSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<template>
<NcAppSidebar v-if="currentBoard && currentCard"
ref="cardSidebar"
:active="tabId"
:name="title"
:subname="subtitle"
Expand All @@ -13,6 +14,7 @@
@update:nameEditable="handleUpdateTitleEditable"
@update:name="handleUpdateTitle"
@submit-name="handleSubmitTitle"
@opened="focusHeader"
@close="closeSidebar">
<template #secondary-actions>
<NcActionButton v-if="cardDetailsInModal && isFullApp" icon="icon-menu-sidebar" @click.stop="closeModal()">
Expand Down Expand Up @@ -153,7 +155,15 @@ export default {
},
},
},
watch: {
currentCard() {
this.focusHeader()
},
},
methods: {
focusHeader() {
this.$refs.cardSidebar.$el.querySelector('.app-sidebar-header__mainname').focus()
},
handleUpdateTitleEditable(value) {
this.titleEditable = value
if (value) {
Expand Down

0 comments on commit f70cd2d

Please sign in to comment.