BuilderIO / BuilderIO/builder

CMS Data Model Object Type number key lookup

Open
#1,955 0 comments 0 reactions 1 assignee Claimed by @samijaber View on GitHub
Dominant language
TypeScript
Stars
8.8k
Forks
1.2k
Avg merge
1d 6h
Merged PRs (30d)
17

Description

**Describe the bug**
When creating a CMS Data Model with an object that has numbers as keys the data binding fails.
It tries to access the data with:
```javascript
state.dataModel.object.1
```
In this case it then returns the entire object and not the selected value.

**To Reproduce**
Steps to reproduce the behavior:
1. Create a CMS Data Model.
2. Add an object field with a field that has a number key.
3. Connect the model to your page and bind the object field anywhere.

**Expected behavior**
I expect to be able to use number keys, that are used as a string to lookup the property.

This should work:
```javascript
state.dataModel.object["1"]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.