Skip to content

Bug: TextField component in Lit renderer ignores "type" property (e.g. "number") #343

@SliverKeigo

Description

@SliverKeigo

Describe the bug

The TextField component in the Lit renderer fails to respect the type property defined in the A2UI JSON payload. For example, when { "type": "number" } is sent, the input field still renders as a default text input (type="text"), allowing
non-numeric characters to be entered.

Screenshots

1. The JSON payload sends "type": "number":
JSON Payload

2. But the UI still accepts non-numeric input (e.g., "2abc"):
UI Bug

Root Cause

There is a property name mismatch between the root renderer and the component:

  • root.ts passes the value to a property named .type.
  • text-field.ts expects a property named inputType.

Because of this mismatch, the type value is never correctly set on the component instance, defaulting to text.

Fix

I have submitted a fix in PR #342 that aligns the property names to textFieldType to avoid conflicts and ensure correct binding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions