fix(lit): correctly bind TextField type property to enable number inputs
Description
This PR fixes an issue where the TextField component in the Lit renderer was ignoring the type property (e.g., "number") from the A2UI JSON payload.
Problem
A property name mismatch between the renderer and component caused the input type to be ignored:
| Location | Property Name | Code |
|---|---|---|
root.ts (Sender) |
.type |
.type=${node.properties.type} |
text-field.ts (Receiver) |
inputType |
accessor inputType |
Result: <input type="number"> rendered as <input type="text">, allowing non-numeric input in number fields.
Solution
-
Lit Component (
text-field.ts): RenamedinputType→textFieldTypeto avoid conflicts with the component's class type identifier. -
Root Renderer (
root.ts): Updated binding to.textFieldType=${node.properties.type}. -
Samples (
a2ui_examples.py): Added explicit"type": "shortText"and"type": "number"usage for clarity.
Verification
- ✅
textFieldTypecorrectly receives values from JSON payload - ✅ HTML input renders with
type="number"when specified
Hi @jacobsimionato 👋
Could you please take a look or help arrange a review?
Thanks! 🙏