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

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 KaelWD mentioned this pull request Jul 3, 2024
1 task
@KaelWD
Copy link
Member

KaelWD commented Jul 3, 2024

#20092

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

Successfully merging this pull request may close these issues.

2 participants