vuetify icon indicating copy to clipboard operation
vuetify copied to clipboard

[Bug Report][3.6.6] VChip has different width for 'flat' and 'outlined' variants

Open frederikheld opened this issue 1 year ago • 3 comments

Environment

Vuetify Version: 3.6.6 Vue Version: 3.4.27 Browsers: Firefox 126.0 OS: Ubuntu undefined

Steps to reproduce

In my case: use the v-chip as toggle-item that shows the two states as flat and outlined variants. You will see how the width changes which can sometimes unexpectedly wrap the line if multiple chips are displayed inline.

Expected Behavior

Chip should have same width regardless of variant.

Actual Behavior

Chip changes width depending on variant

Reproduction Link

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

frederikheld avatar May 19 '24 18:05 frederikheld

I was able to "fix" this by conditionally adding a span around the v-chip text that has a margin left and right of 0.085em each. But I don't know if this is the right unit to keep it consistent and if this solution would work in other contexts as well.

frederikheld avatar May 19 '24 18:05 frederikheld

The same applies for the button, as well - the outlined variant increases the width by 2px.

mirocklez avatar May 20 '24 08:05 mirocklez

Okay, well. It's just too obvious that the border would be a pixel value XD I replaced 0.085em with 1px on each side and can confirm the fix.

frederikheld avatar May 20 '24 10:05 frederikheld

I'd consider this to be a pretty typical issue with anything that has a border applied to it, since the border adds to the dimensions of the element for it's purposes. Ideally, for design purposes, they would be identical in width. This is not really a bug though as nothing here is actually broken.

MatthewAry avatar Nov 16 '24 17:11 MatthewAry