Skip to content

InputRoot: type prop captured non-reactively — post-mount type changes are silently inert #757

Description

@johnleider

Bug

Input.Root's type prop is captured as a plain, non-reactive field on InputRootContext: the context interface declares readonly type: string (packages/0/src/components/Input/InputRoot.vue — every sibling field is a ref/getter), and setup assigns the destructured prop value once into the provided context object. Input.Control reads that frozen value, so changing :type on Input.Root after mount never reaches the rendered control element.

Reproduction

Bind :type to a ref, toggle 'password''text' (the classic reveal-password toggle), and inspect the <input>'s DOM type attribute — it never changes. Verified via document.querySelector('input').type before/after toggle: icon/state around it updates, the control does not.

Expected

type should be reactive like the context's other fields (wrap with toRef when placed on the context, and have InputControl read it reactively).

Context

Found while building a downstream design-system field component with a reveal toggle; worked around with <Input.Root :key="type"> (full remount — costs transient validation state + focus on toggle), so not urgent downstream, but the primitive's contract implies reactivity.

Metadata

Metadata

Assignees

Labels

T: bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions