supermedium / superframe

:package: A super collection of A-Frame components.
https://supermedium.com/superframe/
MIT License
1.36k stars 426 forks source link

[state] `bind-for` interpolation converts `0` to empty string #245

Open dsinni opened 4 years ago

dsinni commented 4 years ago

When using string interpolation in bind-for, e.g., data-order="{{sortOrder}}", the value of 0 gets converted to an empty string, rather than returning 0.

initialState: {
  users: [
    sortOrder: 0,
    ...
  ]
}
<a-entity bind-for ...>
  <template>
    <a-entity data-order="{{sortOrder}}"></a-entity>
  </template>
</a-entity>

The above results as below when the value is 0:

<a-entity data-order=""></a-entity>
dsinni commented 4 years ago

This is happening in version 6.8.0, but haven't checked against all other versions yet.