Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/notifications-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/notifications-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/notifications-settings.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/notifications-settings.js.map

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion src/Components/HeaderMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
<div v-show="opened"
:id="`header-menu-${id}`"
class="header-menu__wrapper"
role="menu">
role="menu"
@focusout="handleFocusOut">
<div class="header-menu__content">
<slot />
</div>
Expand Down Expand Up @@ -157,6 +158,12 @@ export default {
this.$emit('update:open', false)
}
},
handleFocusOut(event) {
if (!event.currentTarget.contains(event.relatedTarget)) {
this.closeMenu()
}
},
},
}
</script>
Expand Down
14 changes: 14 additions & 0 deletions src/NotificationsApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,16 @@ export default {

methods: {
onOpen() {
this.focusFirstFocusable()
this.requestWebNotificationPermissions()
},

focusFirstFocusable() {
this.$nextTick(() => {
this.$el.querySelector('.button-vue').focus()
})
},

handleNetworkOffline() {
console.debug('Network is offline, slowing down pollingInterval to ' + this.pollIntervalBase * 10)
this._setPollingInterval(this.pollIntervalBase * 10)
Expand Down Expand Up @@ -481,6 +489,12 @@ export default {
</script>

<style scoped lang="scss">
:deep(.button-vue) {
&:focus {
outline: 2px solid var(--color-main-text) !important;
}
}
Comment on lines +492 to +496
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth raising an upstream issue in the vue library? That should basically affect every place this is done?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on https://github.com/nextcloud/nextcloud-vue/blob/ade7ba30f759700b3a0b28dca227009ef8157153/src/components/NcButton/NcButton.vue#L426-L429 would say this should only be done in specific cases like these where it is necessary


.notifications-button__icon {
filter: var(--background-image-invert-if-bright);
}
Expand Down