fix(lit): correctly bind TextField type property to enable number inputs #342
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes an issue where the
TextFieldcomponent in the Lit renderer was ignoring thetypeproperty (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:
root.ts(Sender).type.type=${node.properties.type}text-field.ts(Receiver)inputTypeaccessor inputTypeResult:
<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 payloadtype="number"when specifiedHi @jacobsimionato 👋
Could you please take a look or help arrange a review?
Thanks! 🙏