builder icon indicating copy to clipboard operation
builder copied to clipboard

CMS Data Model Object Type number key lookup

Open PhilGarb opened this issue 2 years ago • 0 comments

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:

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:

state.dataModel.object["1"]

PhilGarb avatar Mar 28 '23 12:03 PhilGarb