frontend-collective / frontend-collective/react-sortable-tree

Subtitle not rendered as expected when its values is zero

Open
#890 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5k
Forks
914
PR merge metrics
No merged PRs in 30d

Description

### Problem
When the value of the **Subtitle** is equal to **zero** the size of the **Title** becomes bigger and the value of the **Subtitle** stays in front of the Title instead of below it.

### Screenshot

![image](https://user-images.githubusercontent.com/38235780/119146285-daf2d800-ba20-11eb-9289-efac8c8a95a6.png)

### Sugestion

In line 151 of the file [node-renderer-default.js](https://github1s.com/frontend-collective/react-sortable-tree/blob/HEAD/src/node-renderer-default.js) there is no verification if the variable `nodeSubtitle` is an integer, so the value zero becomes falsy.

##### Reference
Here is an [article](https://kentcdodds.com/blog/use-ternaries-rather-than-and-and-in-jsx) that may help to solve the problem.

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.