Skip to content

Support editing properties of type array without oneOf, selector and selectorAll#855

Merged
dmarcos merged 2 commits into
aframevr:masterfrom
vincentfretin:fix-type-array-of-string
Apr 28, 2026
Merged

Support editing properties of type array without oneOf, selector and selectorAll#855
dmarcos merged 2 commits into
aframevr:masterfrom
vincentfretin:fix-type-array-of-string

Conversation

@vincentfretin
Copy link
Copy Markdown
Contributor

@vincentfretin vincentfretin commented Apr 23, 2026

Add support for editing a property of type array without oneOf like animation startEvents, selector and selectorAll types.

I did the same in aframe-editor c-frame#69 already released in 1.7.25

… startEvents

InputWidget now owns its (de)serialization (mirroring SelectWidget's
pattern): it accepts value as string, array, or custom object, and
when a schema is provided it stringifies non-string values via
schema.stringify for display and parses the input back via schema.parse
on change for array-typed properties. 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"). The "custom string type like event-set"
stringify previously done in PropertyRow is also moved here.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vincentfretin vincentfretin force-pushed the fix-type-array-of-string branch from 25b245f to f005eed Compare April 25, 2026 09:46
For selector and selectorAll types, read the value from getDOMAttribute
(the raw selector string) rather than props.data (the parsed
Element/NodeList), and commit on blur instead of on every keystroke —
querying the DOM on each character is wasteful and a partial selector
is rarely valid. Omit the schema when rendering InputWidget so the
typed string is passed through to setAttribute as-is, which A-Frame
preserves verbatim in attrValue even if it doesn't resolve.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vincentfretin vincentfretin changed the title Support editing a property of type array without oneOf like animation startEvents Support editing properties of type array without oneOf, selector and selectorAll Apr 25, 2026
@vincentfretin vincentfretin marked this pull request as ready for review April 25, 2026 10:29
@dmarcos
Copy link
Copy Markdown
Member

dmarcos commented Apr 28, 2026

thanks

@dmarcos dmarcos merged commit 4224255 into aframevr:master Apr 28, 2026
1 check passed
@vincentfretin vincentfretin deleted the fix-type-array-of-string branch April 28, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants