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

Open
#245 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
frontend

Research direction

Start by reproducing the bind-for interpolation example with sortOrder set to 0, then trace the state interpolation path used for data-order. Done means the rendered a-entity retains the value as "0" rather than an empty string; no file or test path is identified in the issue.

Written by the indexing model from the issue text.

Description

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>
Dominant language
JavaScript
Stars
1.4k
Forks
425
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supermedium/superframe

All issues in supermedium/superframe

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.