mirror of
https://github.com/nextcloud/server.git
synced 2026-06-12 18:21:40 -04:00
Merge pull request #35090 from nextcloud/enh/a11y-close-on-focusout
Close global search menu when keyboard focus leaves
This commit is contained in:
commit
dceb562d9c
4 changed files with 16 additions and 5 deletions
|
|
@ -36,7 +36,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>
|
||||
|
|
@ -161,6 +162,12 @@ export default {
|
|||
this.$emit('update:open', false)
|
||||
}
|
||||
},
|
||||
|
||||
handleFocusOut(event) {
|
||||
if (!event.currentTarget.contains(event.relatedTarget)) {
|
||||
this.closeMenu()
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -73,7 +73,11 @@
|
|||
</form>
|
||||
|
||||
<!-- Search filters -->
|
||||
<NcActions v-if="availableFilters.length > 1" class="unified-search__filters" placement="bottom">
|
||||
<NcActions v-if="availableFilters.length > 1"
|
||||
class="unified-search__filters"
|
||||
placement="bottom"
|
||||
container=".unified-search__input-wrapper">
|
||||
<!-- FIXME use element ref for container after https://github.com/nextcloud/nextcloud-vue/pull/3462 -->
|
||||
<NcActionButton v-for="type in availableFilters"
|
||||
:key="type"
|
||||
icon="icon-filter"
|
||||
|
|
|
|||
4
dist/core-unified-search.js
vendored
4
dist/core-unified-search.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-unified-search.js.map
vendored
2
dist/core-unified-search.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue