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

fix(VMenu): fix min width #18934

Closed
wants to merge 1 commit into from

Conversation

lzl0304
Copy link
Contributor

@lzl0304 lzl0304 commented Dec 27, 2023

Description

fixes #16987

Markup:

<template>
  <v-container>
    <div class="text-center">
      <v-menu>
        <template v-slot:activator="{ props }">
          <v-btn v-bind="props">
            Auto width
          </v-btn>
        </template>
        <v-list>
          <v-list-item>
            <v-list-item-title>Here</v-list-item-title>
          </v-list-item>
        </v-list>
      </v-menu>
      <v-menu min-width="500">
        <template v-slot:activator="{ props }">
          <v-btn v-bind="props">
            Min width
          </v-btn>
        </template>
        <v-list>
          <v-list-item>
            <v-list-item-title>Here</v-list-item-title>
          </v-list-item>
        </v-list>
      </v-menu>
    </div>
  </v-container>
</template>

@MajesticPotatoe MajesticPotatoe added T: bug Functionality that does not work as intended/expected C: VMenu VMenu labels Dec 27, 2023
@johnleider johnleider force-pushed the master branch 2 times, most recently from f931c2e to 748056c Compare December 28, 2023 22:41
@@ -254,6 +256,21 @@ export const VOverlay = genericComponent<OverlaySlots>()({
emit('afterLeave')
}

const mergedStyle = computed(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be easier to just change the style ordering?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If only the order is changed, when min-width is not set in v-menu, min-width: undefined in dimensionStyles will override the default min-width in contentStyles, so I fixed it this way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your proposed fix just seems to be overly complex on the surface. Surely there is a less engineered way to approach this. I'll think on it.

@lzl0304 lzl0304 force-pushed the fix/16987-v-menu-min-width branch from 79aef43 to 3d17b99 Compare January 17, 2024 06:44
@KaelWD KaelWD force-pushed the master branch 3 times, most recently from cd170f8 to 98e57dc Compare February 14, 2024 06:14
@johnleider johnleider added the S: stale This issue is untriaged and hasn't seen any activity in at least six months. label Feb 29, 2024
@johnleider
Copy link
Member

This Pull Request is being closed due to inactivity.

If you have any additional questions, please reach out to us in our Discord community.

@johnleider johnleider closed this Mar 28, 2024
@lzl0304 lzl0304 deleted the fix/16987-v-menu-min-width branch April 22, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VMenu VMenu S: stale This issue is untriaged and hasn't seen any activity in at least six months. T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report][3.1.11] v-menu min-width property does not work
3 participants