Skip to content

Commit

Permalink
fixup! fix(RightSidebar): use new open state to fix focus trap on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
ShGKme committed Jun 26, 2024
1 parent 504e185 commit ad63ab8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
28 changes: 17 additions & 11 deletions src/components/RightSidebar/RightSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,19 @@
:active="activeTab"
:class="'active-tab-' + activeTab"
:toggle-classes="{ 'chat-button': isInCall }"
:toggle-attrs="isInCall ? { 'data-theme-dark': true } : undefined"
:toggle-attrs="isInCall ? inCallToggleAttrs : undefined"
@update:open="handleUpdateOpen"
@update:active="handleUpdateActive"
@closed="handleClosed"
@close="handleClose">
<!-- Use a custom icon when sidebar is used for chat messages during the call -->
<template #toggle-icon>
<template v-if="isInCall">
<MessageText :size="20" />
<NcCounterBubble v-if="unreadMessagesCounter > 0"
class="chat-button__unread-messages-counter"
:type="hasUnreadMentions ? 'highlighted' : 'outlined'">
{{ unreadMessagesCounter }}
</NcCounterBubble>
</template>
<template v-if="isInCall" #toggle-icon>
<MessageText :size="20" />
<NcCounterBubble v-if="unreadMessagesCounter > 0"
class="chat-button__unread-messages-counter"
:type="hasUnreadMentions ? 'highlighted' : 'outlined'">
{{ unreadMessagesCounter }}
</NcCounterBubble>
</template>
<template #description>
<LobbyStatus v-if="canFullModerate && hasLobbyEnabled" :token="token" />
Expand Down Expand Up @@ -177,7 +175,7 @@ export default {
return this.$store.getters.getSidebarStatus
},
opened() {
return !!this.token && !this.isInLobby && this.show
return !this.isInLobby && this.show
},
token() {
return this.$store.getters.getToken()
Expand Down Expand Up @@ -311,6 +309,14 @@ export default {
hasUnreadMentions() {
return this.conversation.unreadMention
},
inCallToggleAttrs() {
return {
'data-theme-dark': true,
'aria-label': t('spreed', 'Open chat'),
title: t('spreed', 'Open chat')
}
},
},
watch: {
Expand Down
1 change: 0 additions & 1 deletion src/components/TopBar/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
<script>
import AccountMultiple from 'vue-material-design-icons/AccountMultiple.vue'
import { showMessage } from '@nextcloud/dialogs'
import { emit } from '@nextcloud/event-bus'
import { t, n } from '@nextcloud/l10n'
Expand Down

0 comments on commit ad63ab8

Please sign in to comment.