Skip to content

fix(VField): correct outline label position for tile variant - #23069

Open
waterWang wants to merge 1 commit into
vuetifyjs:masterfrom
waterWang:fix/vfield-outline-tile-label-position
Open

fix(VField): correct outline label position for tile variant#23069
waterWang wants to merge 1 commit into
vuetifyjs:masterfrom
waterWang:fix/vfield-outline-tile-label-position

Conversation

@waterWang

Copy link
Copy Markdown
Contributor

Description

Fixes #22269

The [class^="rounded-"] CSS selector was also matching the rounded-0 class (applied by the tile prop), which caused the outline __start element to get a wider flex-basis intended for rounded corners.

Root Cause

In VField.sass, the outline __start element has these rules:

  1. Default: flex: 0 0 $field-control-affixed-padding (12px)
  2. Override for rounded: flex-basis: calc(var(--v-input-control-height) / 2 + 2px) (≈30px)

The override selector [class^="rounded-"] matches rounded-0 (tile), causing the __start to be 30px wide when it should be 12px. This shifts the notch and label to the right.

Fix

Added an explicit override for .rounded-0 to restore the correct $field-control-affixed-padding (12px) flex-basis, so the label properly aligns with the outline border on tiled fields.

Reproduction

<template>
  <v-app>
    <v-container>
      <v-text-field
        model-value="Hi!"
        label="Label"
        variant="outlined"
        hide-details
        tile
      />
      <v-text-field
        model-value="Hi!"
        label="Label"
        variant="outlined"
        hide-details
      />
    </v-container>
  </v-app>
</template>

The first field (tiled) has the label slightly misaligned (too far right). After the fix, both fields have correctly aligned labels.

The [class^="rounded-"] CSS selector was also matching the rounded-0
class (applied by the tile prop), which caused the outline __start
element to get a wider flex-basis intended for rounded corners.

Added an explicit override for .rounded-0 to restore the correct
-control-affixed-padding (12px) flex-basis, so the label
aligns properly with the outline border on tiled fields.

Closes vuetifyjs#22269
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report][3.10.8] Outline VTextField Label position

1 participant