You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you need to override it, you can use the valueLabelTrue and valueLabelFalse props which both accept a string. Those strings may be translation keys:
<BooleanField source="published" valueLabelTrue="Has been published" valueLabelFalse="Has not been published yet" />
i want to override the display for bool value ,but it did not on effect.
Steps to reproduce:
<List>
<Datagrid rowClick={rowClick} expand={PostPanel} optimized>
<BooleanField
source="commentable"
label="resources.posts.fields.commentable_short"
sortable={false}
valueLabelTrue="Has been published"
valueLabelFalse="Has not been published yet"
/>
</Datagrid>
</List>
``` in simple post list
**Environment**
* React-admin version:3.0
The text was updated successfully, but these errors were encountered:
fzaninotto
changed the title
<BooleanField source="published" valueLabelTrue="Has been published" valueLabelFalse="Has not been published yet" />
valueLabelTrue and valueLabelFalse props of <BooleanField> have no effect
Nov 26, 2019
The BooleanField also includes an hidden text for accessibility (or to query in end to end tests). By default, it includes the translated label and the translated value, for example Published: false.
The valueLabelTrue and valueLabelFalse props do work, you just can't see the related text on a normal web browser. Only screen readers will say it.
That being said, we can do better and provide both a fallback for screen readers AND a tooltip for most users. I'm marking this as an enhancement.
What you were expecting:
i want to override the display for bool value ,but it did not on effect.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: