gregnb / gregnb/mui-datatables

Boolean data customBodyRender bug

Open
#991 5 comments 0 reactions 0 assignees View on GitHub
community feedback
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

If the column data is boolean and `customBodyRender` is set, the logic function always receives `true` value.

## Expected Behavior
The `value` should be either `true` or `false` depending on the actual value

## Current Behavior
Value received in `logic` function is always `true`

## Steps to Reproduce (for bugs)
https://codesandbox.io/s/trusting-tharp-2ldj7

1. Filter the column `salary` with `Yes` or `No` it won't work with the option `No` as the value is always true.
2. Comment the `customBodyRender` line
3. Try to filter again and it will work this time

Another way to see the problem you could `console.log(salary)` in the beginning of the `logic` function and re-run the above procedure to see the value sent to the `logic` function

## Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | 4.5 |
| MUI-datatables | 2.12 |
| React | 16.8.6 |

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked CodeSandbox reproduction and trace the boolean value passed through customBodyRender during column filtering. Verify that both true and false values reach the logic function, then confirm that filtering with the No option works without removing customBodyRender.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.