Skip to content

Commit

Permalink
fix(VTextField): remain placeholder after values selected (#16565)
Browse files Browse the repository at this point in the history
fixes #16519
fixes #16493

Co-authored-by: John Leider <john@vuetifyjs.com>
  • Loading branch information
gitemad and johnleider committed Mar 28, 2023
1 parent c04c302 commit 33cc351
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vuetify/src/components/VTextField/VTextField.tsx
Expand Up @@ -208,6 +208,10 @@ export const VTextField = genericComponent<Omit<VInputSlots & VFieldSlots, 'defa
default: ({
props: { class: fieldClass, ...slotProps },
}) => {
const placeholder = computed(() => {
return ((props.persistentPlaceholder || isFocused.value) && !isDirty.value) ? props.placeholder : ''
})

const inputNode = (
<input
ref={ inputRef }
Expand All @@ -220,7 +224,7 @@ export const VTextField = genericComponent<Omit<VInputSlots & VFieldSlots, 'defa
readonly={ isReadonly.value }
disabled={ isDisabled.value }
name={ props.name }
placeholder={ props.placeholder }
placeholder={ placeholder.value }
size={ 1 }
type={ props.type }
onFocus={ onFocus }
Expand Down

0 comments on commit 33cc351

Please sign in to comment.