Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Boolean values not showing #539

Closed
moi90 opened this issue Aug 8, 2019 · 3 comments · Fixed by #593
Closed

Boolean values not showing #539

moi90 opened this issue Aug 8, 2019 · 3 comments · Fixed by #593
Assignees
Labels
dash-type-bug Something isn't working as intended dash-type-enhancement New feature or request size: 2
Milestone

Comments

@moi90
Copy link

moi90 commented Aug 8, 2019

Like in the experimental version, cells with boolean values are empty, regardless of True or False.

plotly/dash-table-experiments#10

@Marc-Andre-Rivet Marc-Andre-Rivet added the dash-type-bug Something isn't working as intended label Aug 8, 2019
@Marc-Andre-Rivet
Copy link
Contributor

Marc-Andre-Rivet commented Aug 8, 2019

Notes for implementation:

This is caused by react's inability to handle boolean values inside of jsx(tsx).

See current usage: https://github.com/plotly/dash-table/blob/master/src/dash-table/components/CellLabel/index.tsx#L27

By changing line 27 for something like:

            {typeof value === 'boolean' ?
                value.toString() :
                value
            }

we should be able to display the boolean under a string format.

Additionally, adding support for PropTypes.bool in the dropdown props seems to work as-is with the current dropdown implementation and should be folded in with the explicit toString fix.

One of the dropdown props: https://github.com/plotly/dash-table/blob/master/src/dash-table/dash/DataTable.js#L686

That said, the table does not currently have native boolean type support and the resolution of this issue would not add that support.

Greatest uncertainty is how this is going to be handled by filtering and sorting.

Add some tests for label / input (focused) / dropdown (focused) + updating as text or from dropdown + check behavior of various filter ops & sort.

@Marc-Andre-Rivet
Copy link
Contributor

Marc-Andre-Rivet commented Aug 8, 2019

@moi90 Thanks for reporting this issue.

@Marc-Andre-Rivet Marc-Andre-Rivet added size: 2 dash-type-enhancement New feature or request and removed size: 1 labels Aug 8, 2019
@moi90
Copy link
Author

moi90 commented Aug 12, 2019

@Marc-Andre-Rivet Thanks for working on this issue!

So far, I convert Boolean values before displaying them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dash-type-bug Something isn't working as intended dash-type-enhancement New feature or request size: 2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants