mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-29 13:27:31 -07:00
Fix jumping to top of page when opening menu
I also thought this would maybe fix one of the focustrap errors in the console, but no.
This commit is contained in:
parent
d1cdd58bc1
commit
affeb55c01
1 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<FocusTrap v-bind:active="isActive">
|
||||
<div tabindex="-1" v-focus>
|
||||
<FocusTrap :active="false" ref="focusTrap">
|
||||
<div tabindex="-1">
|
||||
<div
|
||||
ref="itemsEl"
|
||||
class="rrevdjwt _popup _shadow"
|
||||
|
@ -206,6 +206,7 @@ import { i18n } from "@/i18n";
|
|||
import { FocusTrap } from 'focus-trap-vue';
|
||||
|
||||
const XChild = defineAsyncComponent(() => import("./MkMenu.child.vue"));
|
||||
const focusTrap = ref();
|
||||
|
||||
const props = defineProps<{
|
||||
items: MenuItem[];
|
||||
|
@ -316,6 +317,8 @@ function focusDown() {
|
|||
}
|
||||
|
||||
onMounted(() => {
|
||||
focusTrap.value.activate();
|
||||
|
||||
if (props.viaKeyboard) {
|
||||
nextTick(() => {
|
||||
focusNext(itemsEl.children[0], true, false);
|
||||
|
|
Loading…
Reference in a new issue