-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: make NumberCell for Vanilla Renderer show 0 #1658
Conversation
Thank you very much for the contribution! Could you also add a testcase? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A smaller fix could be to replace data || ''
with data ?? ''
, right? If you agree please adapt this PR.
return ( | ||
<input | ||
type='number' | ||
step='0.1' | ||
value={data || ''} | ||
value={value} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value={value} | |
value={data ?? ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, thanks! I am making the change now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I would love to add a testcase, but for the moment I am not familiar with how enzyme works, or testing for react components in general, so it might take me some time 😅
The React Vanilla NumberCell now correctly displays the number 0 instead of an empty string. Co-authored-by: Stefan Dirix <sdirix@eclipsesource.com>
When using a default value of 0 for a number cell with vanilla renderers, the input is shown with an empty string. This is a quick fix for it.