Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(VMenu): make activation by arrow keys optional #20091

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fostdvelop
Copy link

Description

To keep arrow key functionality in v-list, it is required that v-menu doesn't activate on arrow-key. To not break anything this is made optional as par the standard WCAG 2.

Markup:

On v-menu now exists a property disableArrowKeysActivation.

<template>
  <v-list>
    <v-list-item v-for="i in 5">
      <v-menu :disableArrowKeysActivation="true">
        <template v-slot:activator="{ props }">
          <v-btn v-bind="props">Click me {{ i }}</v-btn>
        </template>
        <v-list v-focus>
          <v-list-item v-for="j in 5" @click="log">
            {{ j }}
          </v-list-item>
        </v-list>
      </v-menu>
    </v-list-item>
  </v-list>
</template>

<script setup>
function log() {
  console.log("hello world");
}

const vFocus = {
  mounted: (el) => {
    setTimeout(() => el.focus(), 50);
  }
}
</script>
@KaelWD
Copy link
Member

KaelWD commented Jul 3, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants