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(VField, VInput): emit click:* events using keyboard #20878

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

J-Sek
Copy link
Contributor

@J-Sek J-Sek commented Jan 17, 2025

Description

fixes #20864

Markup:

<template>
  <v-app>
    <v-container>
      <v-row justify="center">
        <v-col cols="12" sm="8">
          <v-alert class="mb-4" type="info" text="Focus each icon and use keyboard [Space] and [Enter]" />
          <v-text-field
            v-model="password"
            :append-icon="show ? 'mdi-eye' : 'mdi-eye-off'"
            :append-inner-icon="show ? 'mdi-eye' : 'mdi-eye-off'"
            :prepend-icon="show ? 'mdi-eye' : 'mdi-eye-off'"
            :prepend-inner-icon="show ? 'mdi-eye' : 'mdi-eye-off'"
            :type="show ? 'text' : 'password'"
            hint="At least 8 characters"
            label="Password"
            persistent-hint
            clearable
            @click:append="show = !show"
            @click:appendInner="show = !show"
            @click:prepend="show = !show"
            @click:prependInner="show = !show"
          />
        </v-col>
        <v-col cols="12" sm="8">
          <v-combobox
            v-model="comboChips"
            append-icon="$plus"
            append-inner-icon="$plus"
            prepend-icon="$plus"
            prepend-inner-icon="$plus"
            chips multiple clearable
            @click:append="comboChips.push('append')"
            @click:appendInner="comboChips.push('appendInner')"
            @click:prepend="comboChips.push('prepend')"
            @click:prependInner="comboChips.push('prependInner')"
          />
        </v-col>
        <v-col cols="12" sm="8">
          <v-textarea
            v-model="clicksLog"
            append-icon="mdi-cow"
            append-inner-icon="mdi-cow"
            prepend-icon="mdi-cow"
            prepend-inner-icon="mdi-cow"
            auto-grow clearable
            @click:append="clicksLog += '\nappend'"
            @click:appendInner="clicksLog += '\nappendInner'"
            @click:prepend="clicksLog += '\nprepend'"
            @click:prependInner="clicksLog += '\nprependInner'"
          />
        </v-col>
      </v-row>
    </v-container>
  </v-app>
</template>

<script setup>
  import { ref } from 'vue'

  const show = ref(false)
  const password = ref('Password')
  const clicksLog = ref('')
  const comboChips = ref([])
</script>

@J-Sek J-Sek self-assigned this Jan 17, 2025
@J-Sek J-Sek added a11y Accessibility issue C: VInput VInput C: VField labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Accessibility issue C: VField C: VInput VInput
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report][3.7.6] v-text-field append-icon click handler does not support keyboard input
1 participant