Skip to content

Commit

Permalink
fix(VTextField): don't show counter unless counter prop is set
Browse files Browse the repository at this point in the history
fixes #18342
  • Loading branch information
KaelWD committed Sep 28, 2023
1 parent 3832f73 commit e3554bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vuetify/src/components/VTextField/VTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const activeTypes = ['color', 'file', 'time', 'date', 'datetime-local', 'week',

export const makeVTextFieldProps = propsFactory({
autofocus: Boolean,
counter: [Boolean, Number, String] as PropType<true | number | string>,
counter: [Boolean, Number, String],
counterValue: [Number, Function] as PropType<number | ((value: any) => number)>,
prefix: String,
placeholder: String,
Expand Down Expand Up @@ -154,7 +154,7 @@ export const VTextField = genericComponent<VTextFieldSlots>()({
}

useRender(() => {
const hasCounter = !!(slots.counter || props.counter || props.counterValue)
const hasCounter = !!(slots.counter || (props.counter !== false && props.counter != null))
const hasDetails = !!(hasCounter || slots.details)
const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)
const [{ modelValue: _, ...inputProps }] = VInput.filterProps(props)
Expand Down

0 comments on commit e3554bb

Please sign in to comment.