Skip to content

Comments

fix(VMenu): use last known position if target is hidden#21145

Merged
KaelWD merged 1 commit intomasterfrom
fix/20515-menu-hidden-target
Apr 22, 2025
Merged

fix(VMenu): use last known position if target is hidden#21145
KaelWD merged 1 commit intomasterfrom
fix/20515-menu-hidden-target

Conversation

@KaelWD
Copy link
Member

@KaelWD KaelWD commented Mar 24, 2025

Description

fixes #20515

Markup:

<template>
  <v-app>
    <v-container>
      <div style="height: 200px" />

      <div class="CONTAINER">
        <v-menu v-model="menu">
          <template #activator="{ props }">
            <v-btn class="BUTTON" color="primary" v-bind="props">
              Activator slot
            </v-btn>
          </template>
          <v-list>
            <v-list-item
              v-for="(item, index) in items"
              :key="index"
              :value="index"
            >
              <v-list-item-title>{{ item.title }}</v-list-item-title>
            </v-list-item>
          </v-list>
        </v-menu>
      </div>

      <div style="height: 2000px" />
    </v-container>
  </v-app>
</template>

<script setup>
  import { ref } from 'vue'
  const items = ref([
    { title: 'Click Me' },
    { title: 'Click Me' },
    { title: 'Click Me' },
    { title: 'Click Me 2' },
  ])
  const menu = ref(false)
</script>

<style>
.CONTAINER {
  display: flex;
  justify-content: center;
  padding: 16px;
  background-color: lightblue;
  height: 120px;
}

.BUTTON {
  display: none;
}

.CONTAINER:hover .BUTTON {
  display: block;
}
</style>

@KaelWD KaelWD requested a review from jcjp March 24, 2025 04:09
@MajesticPotatoe MajesticPotatoe added T: bug Functionality that does not work as intended/expected C: VMenu labels Mar 24, 2025
@KaelWD KaelWD added this to the v3.8.x milestone Apr 22, 2025
@KaelWD KaelWD merged commit 00814a3 into master Apr 22, 2025
19 checks passed
@KaelWD KaelWD deleted the fix/20515-menu-hidden-target branch April 22, 2025 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: VMenu T: bug Functionality that does not work as intended/expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] VMenu location-strategy repositioning when activator display none

3 participants