Support editing a property of type array without oneOf like animation startEvents#1572
Support editing a property of type array without oneOf like animation startEvents#1572vincentfretin wants to merge 1 commit into
Conversation
… startEvents
For array-type properties without oneOf (rendered via InputWidget),
stringify the array for display using schema.stringify (", "-joined)
and parse the comma-separated string back to an array in onChange.
This ensures A-Frame always receives an array for array-type properties
— avoiding arrayStringify being called on a raw string downstream
(which would crash with "t.join is not a function").
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review: Support editing array-type properties without oneOf (e.g. animation startEvents)Summary: This is a clean backport of aframe-inspector#855 that fixes a crash when editing What the fix doesIn
This correctly distinguishes from the Code Quality
Potential Issues / QuestionsMinor: Redundant null guard — Edge case:
Non-array initial value — The Test CoverageNo tests exist for VerdictApprove. This is a correct, minimal fix for a real crash bug. The logic is sound, the code is clean, and it faithfully follows the upstream fix. No blocking concerns. |
|
Oh you already did a similar fix in |
|
thanks yeah this is one of many bugs I found and solved and forgot about |
|
I modified it with extra goodies in #1573 to backport some changes I did in aframe-inspector/aframe-editor you may benefit in future features. |
For array-type properties without oneOf (rendered via InputWidget), stringify the array for display using schema.stringify (", "-joined) and parse the comma-separated string back to an array in onChange. This ensures A-Frame always receives an array for array-type properties — avoiding arrayStringify being called on a raw string downstream (which would crash with "t.join is not a function").
Backport of aframevr/aframe-inspector#855