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(VCombobox): hide placeholder when dirty #17122

Merged
merged 5 commits into from
Apr 12, 2023
Merged

Conversation

johnleider
Copy link
Member

Motivation and Context

fixes #16519
fixes #16493

Markup:

<template>
  <v-app>
    <v-main>
      <v-autocomplete
        v-model="item"
        placeholder="autocomplete"
        :persistent-placeholder="placeholder"
        :items="['item1','item2']"
        :multiple="multiple"
        :label="label ? 'Label' : undefined"
      />
      <v-combobox
        v-model="item"
        placeholder="combobox"
        :persistent-placeholder="placeholder"
        :items="['item1','item2']"
        :multiple="multiple"
        :label="label ? 'Label' : undefined"
      />
      <v-select
        v-model="item"
        :persistent-placeholder="placeholder"
        :items="['item1','item2']"
        placeholder="select"
        :multiple="multiple"
        :label="label ? 'Label' : undefined"
      />
      <v-text-field
        v-model="msg"
        :persistent-placeholder="placeholder"
        placeholder="text-field"
        :label="label ? 'Label' : undefined"
      />
      <v-textarea
        v-model="msg"
        :persistent-placeholder="placeholder"
        placeholder="text-area"
        :label="label ? 'Label' : undefined"
      />
      <v-switch v-model="label" label="label" />
      <v-switch v-model="multiple" label="multiple" />
      <v-switch v-model="placeholder" label="persist placeholder" />
      <v-btn @click="toggle">Toggle values</v-btn>
    </v-main>
  </v-app>
</template>

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

  const msg = ref('')
  const item = ref()
  const multiple = ref(true)
  const label = ref(false)
  const list = ref(['A', 'B', 'C'])
  const placeholder = ref(false)

  function toggle () {
    if (item.value) item.value = null
    else {
      item.value = multiple.value
        ? list.value
        : list.value[0]
    }
  }
</script>

@johnleider johnleider self-assigned this Apr 10, 2023
@johnleider johnleider added T: bug Functionality that does not work as intended/expected C: VTextField VTextField labels Apr 10, 2023
@johnleider johnleider requested a review from a team April 10, 2023 20:17
@johnleider johnleider added this to the v3.x.x milestone Apr 10, 2023
@marjev
Copy link
Contributor

marjev commented Apr 11, 2023

I believe my PR (#17115) should be closed in favor of this one.

@johnleider johnleider modified the milestones: v3.x.x, v3.1.x Apr 11, 2023
@KaelWD KaelWD changed the title fix(VTextField): placeholder show logic fix(VCombobox): hide placeholder when dirty Apr 12, 2023
@KaelWD KaelWD added C: VSelect VSelect C: VCombobox VCombobox C: VAutocomplete VAutocomplete and removed C: VTextField VTextField labels Apr 12, 2023
@KaelWD KaelWD merged commit 69ce260 into master Apr 12, 2023
@KaelWD KaelWD deleted the fix/text-field-placeholder branch April 12, 2023 15:09
@6XGate
Copy link

6XGate commented Apr 17, 2023

Does this fix #17113 ?

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
4 participants