vuetify icon indicating copy to clipboard operation
vuetify copied to clipboard

[Bug Report][3.6.0] VSelect menu shifted few pixels to the right

Open crystalfp opened this issue 2 months ago • 8 comments

Environment

Vuetify Version: 3.6.0 Vue Version: 3.4.26 Browsers: Chrome 124.0.0.0 OS: Windows 10

Steps to reproduce

Open the dropdown menu. Notice the menu is shifted to the right by 5-10 pixels. Now remove the width style on the container div and the menu returns to normal position.

Expected Behavior

The menu be exactly below the selector.

Actual Behavior

It is shifted to the right if the container specifies a width.

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments

The two

containers are part of the application.

crystalfp avatar May 01 '24 14:05 crystalfp

This is happening because of edge detection and I don't think it's a bug. @KaelWD thoughts?

johnleider avatar May 01 '24 16:05 johnleider

Respectfully disagree. An unexpected behavior caused by something outside my control that gives a visual look not in line with the quality of the framework for me is a bug.

Anyway, changing the DIVs with VContainers changed nothing. The width cannot be removed because the selector is in a side panel of a flex container.

Thanks for looking! mario

crystalfp avatar May 02 '24 03:05 crystalfp

I'm not saying your issue doesn't have merit, just that it's not a bug. If it's not something that can be disabled maybe we add an option to do just that.

johnleider avatar May 02 '24 19:05 johnleider

locationStrategy has a hardcoded viewportMargin as 12px, seems to deliberately keep Overlay minimum 12px away from edge by default. There must be a good reason behind it.

If parent div has a margin over 12px, it's working as expected demo

yuwu9145 avatar May 04 '24 00:05 yuwu9145

Yes, putting the margin makes the dropdown stay where it should stay. Well, the overall effect is not nice as before (the selector filling the upper side of the sidebar) but acceptable. Will be nice if you would like to investigate if this margin is really necessary o if it is possible to switch off (maybe with an option). Anyway, thanks a lot for vuetify! With it my application has a very professional look.

crystalfp avatar May 04 '24 03:05 crystalfp

I think that the user should be able to opt out of this functionality. Surely it can't be too difficult to allow disabling.

johnleider avatar May 04 '24 03:05 johnleider

@KaelWD What was the reason behind https://github.com/vuetifyjs/vuetify/blob/767ecdcedd75a6d28379ee4058b8c3b70bb66feb/packages/vuetify/src/components/VOverlay/locationStrategies.ts#L235

yuwu9145 avatar May 08 '24 12:05 yuwu9145

<template>
  <v-app>
    <v-navigation-drawer>
      <v-select />
    </v-navigation-drawer>
    <v-container>
      <div style="height: 1000px" />
      <v-btn>
        <v-menu activator="parent" location="end">
          <v-list>
            <v-list-item v-for="i in 100">Item</v-list-item>
          </v-list>
        </v-menu>
      </v-btn>
      <div style="height: 3000px" />
    </v-container>
  </v-app>
</template>

Had a chat with John about this on monday, I have an idea for how to fix it.

KaelWD avatar May 08 '24 13:05 KaelWD