[Bug Report] v-menu auto property doesn't properly center the menu items relative to the activator
See original GitHub issueVersions and Environment
Vuetify: 1.5.5 Vue: 2.6.8 Browsers: Chrome 70.0.3538.77 OS: Linux x86_64
Steps to reproduce
Create a v-menu with a button as an activator and put the auto prop on v-menu.
<div id="app">
<v-app id="inspire">
<div class="text-xs-center">
<v-menu
v-model="menu"
:close-on-content-click="false"
auto
offset-y
>
<template v-slot:activator="{ on }">
<v-btn
color="indigo"
dark
v-on="on"
>
Menu as Popover
</v-btn>
</template>
<v-card>
<v-list>
<v-list-tile avatar>
<v-list-tile-avatar>
<img src="https://cdn.vuetifyjs.com/images/john.jpg" alt="John">
</v-list-tile-avatar>
<v-list-tile-content>
<v-list-tile-title>John Leider</v-list-tile-title>
<v-list-tile-sub-title>Founder of Vuetify.js</v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
<v-btn
:class="fav ? 'red--text' : ''"
icon
@click="fav = !fav"
>
<v-icon>favorite</v-icon>
</v-btn>
</v-list-tile-action>
</v-list-tile>
</v-list>
<v-divider></v-divider>
<v-list>
<v-list-tile>
<v-list-tile-action>
<v-switch v-model="message" color="purple"></v-switch>
</v-list-tile-action>
<v-list-tile-title>Enable messages</v-list-tile-title>
</v-list-tile>
<v-list-tile>
<v-list-tile-action>
<v-switch v-model="hints" color="purple"></v-switch>
</v-list-tile-action>
<v-list-tile-title>Enable hints</v-list-tile-title>
</v-list-tile>
</v-list>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn flat @click="menu = false">Cancel</v-btn>
<v-btn color="primary" flat @click="menu = false">Save</v-btn>
</v-card-actions>
</v-card>
</v-menu>
</div>
</v-app>
</div>
Expected Behavior
In the docs it says that if you put auto prop on v-menu it will center the menu items. It should center the v-card relative to the button but it is not centered.
Actual Behavior
The v-menu item has a strange offset to the left but not fully centered.
Reproduction Link
https://codepen.io/anon/pen/aMJOaY?&editable=true&editors=101
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Vuetify menu component auto property doesn't center the ...
I am using the Vuetify menu (as a popover) and in the docs it says that the auto property centers the menu items...
Read more >The Centered Text element - HTML - MDN Web Docs - Mozilla
The <center> HTML element is a block-level element that displays its block-level or inline contents centered horizontally within its containing element. The ...
Read more >You cannot center the text in a column of an inserted table in ...
Describes a problem in which you cannot center the text in a column of an inserted table in Word. Provides three workarounds.
Read more >How to Center Align Items in CSS with 4 Solid Methods.
In a nutshell, a block element can use the text-align property to horizontally center align any text or inline elements inside of it...
Read more >A Practical Guide to Centering in CSS - Stack Diary
Looking for a quick solution to center a text or a div element in CSS? ... I'm certain that the problem with centering...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, I haven’t found a solution yet.
If your activator and v-menu have fixed widths, it can be accomplished by setting nudge-left property:
nudge-left = (vMenuWidth - activatorWidth)/2
Example:
https://codepen.io/talski/pen/zYoojGZ?editors=1010