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(VChip): overflow text in chip selections #17283

Merged
merged 1 commit into from
May 9, 2023

Conversation

johnleider
Copy link
Member

fixes #16472

Ideally this would exist on v-chip all of the time but it causes a breaking change when using icons/avatars with the start or end prop for alignment.

Description

Markup:

<template>
  <v-app>
    <v-main>
      <VCombobox
        v-model="chips"
        chips
        multiple
        clearable
        closable-chips
        clear-icon="mdi-close-circle-outline"
        :items="items"
        label="Your favorite hobbies"
        prepend-icon="mdi-filter-variant"
      />

      <v-card
        class="mx-auto"
        max-width="250"
      >
        <v-row
          align="center"
          class="pa-6"
        >
          <span class="me-4">To</span>

          <v-menu
            v-model="menu"
            location="top start"
            origin="top start"
            transition="scale-transition"
          >
            <template #activator="{ props }">
              <v-chip
                pill
                v-bind="props"
                link
              >
                <!-- <template #prepend> -->
                <v-avatar start>
                  <v-img src="https://cdn.vuetifyjs.com/images/john.png" />
                </v-avatar>
                <!-- </template> -->

                John Leider lorem ipsum
              </v-chip>
            </template>

            <v-card width="300">
              <v-list bg-color="black">
                <v-list-item>
                  <template #prepend>
                    <v-avatar image="https://cdn.vuetifyjs.com/images/john.png" />
                  </template>

                  <v-list-item-title>John Leider</v-list-item-title>

                  <v-list-item-subtitle>john@google.com</v-list-item-subtitle>

                  <template #append>
                    <v-list-item-action>
                      <v-btn
                        icon
                        variant="text"
                        @click="menu = false"
                      >
                        <v-icon>mdi-close-circle</v-icon>
                      </v-btn>
                    </v-list-item-action>
                  </template>
                </v-list-item>
              </v-list>

              <v-list>
                <v-list-item link prepend-icon="mdi-briefcase">
                  <v-list-item-subtitle>john@gmail.com</v-list-item-subtitle>
                </v-list-item>
              </v-list>
            </v-card>
          </v-menu>
        </v-row>

        <v-divider />

        <div class="pa-3">
          <v-text-field
            label="Subject"
            model-value="Re: Vacation Request"
            single-line
            variant="underlined"
          />

          <v-textarea
            label="Message"
            single-line
            variant="underlined"
          />
        </div>
      </v-card>
    </v-main>
  </v-app>
</template>

<script setup>
  import { ref } from 'vue'
  const chips = ref(['Programming', 'Playing video games', 'Sleeping'])
  const items = ref(['Streaming', 'Eating', 'Programming', 'Playing video games for many long time', 'Sleeping'])
  const menu = ref(false)
</script>

@johnleider johnleider added T: bug Functionality that does not work as intended/expected C: VSelect VSelect C: VCombobox VCombobox C: VAutocomplete VAutocomplete labels May 3, 2023
@johnleider johnleider added this to the v3.2.x milestone May 3, 2023
@johnleider johnleider requested a review from a team May 3, 2023 16:35
@johnleider johnleider self-assigned this May 3, 2023
Copy link
Member

@yuwu9145 yuwu9145 left a comment

Choose a reason for hiding this comment

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

Avatar part is working the same as v2, should be good enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VAutocomplete VAutocomplete C: VCombobox VCombobox C: VSelect VSelect 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.1] Vchip is not responsive for small devices
2 participants