Skip to content

TreeCollection no longer allows a 0 (zero) or falsy key value #9991

@lukpsaxo

Description

@lukpsaxo

Provide a general summary of the issue here

Tree.tsx loses items if the key is falsy e.g. 0 or ""

🤔 Expected Behavior?

we can use 0 keys, like we do in the Table and 2 months ago

😯 Current Behavior

list items with a falsy key cause multiple list items to dispapear from the list

💁 Possible Solution

I believe it is Introduced here:

5847e26

but definitely upon upgrade 1.15.1 → 1.17.0

the problem is here:

node = key ? this.getItem(key) : null;

the could should be:

 node = key != null ? this.getItem(key) : null;

🔦 Context

No response

🖥️ Steps to Reproduce

I can put together a repro case if necessary

Version

1.17.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

Linux

🧢 Your Company/Team

Saxo Bank

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions