File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 3737 <div v-show =" opened"
3838 :id =" `header-menu-${id}`"
3939 class =" header-menu__wrapper"
40- role =" menu" >
40+ role =" menu"
41+ @focusout =" handleFocusOut" >
4142 <div class =" header-menu__content" >
4243 <slot />
4344 </div >
@@ -157,6 +158,12 @@ export default {
157158 this .$emit (' update:open' , false )
158159 }
159160 },
161+
162+ handleFocusOut (event ) {
163+ if (! event .currentTarget .contains (event .relatedTarget )) {
164+ this .closeMenu ()
165+ }
166+ },
160167 },
161168}
162169 </script >
Original file line number Diff line number Diff line change @@ -248,8 +248,14 @@ export default {
248248
249249 methods: {
250250 onOpen () {
251+ this .focusFirstFocusable ()
251252 this .requestWebNotificationPermissions ()
252253 },
254+
255+ focusFirstFocusable () {
256+ this .$el .querySelector (' .button-vue' ).focus ()
257+ },
258+
253259 handleNetworkOffline () {
254260 console .debug (' Network is offline, slowing down pollingInterval to ' + this .pollIntervalBase * 10 )
255261 this ._setPollingInterval (this .pollIntervalBase * 10 )
You can’t perform that action at this time.
0 commit comments