value always 'null'
See original GitHub issue<CalendarHeatmap endDate = {new Date(endCalendar)} numDays = {365} values = {schedulesTimes} onClick = {(value) => { alert(value) }} titleForValue = {customTitleForValue} tooltipDataAttrs = {customTooltipDataAttrs} />
when i click the block, it always alert null, have any idea? 😊
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Java value is always null? [duplicate] - Stack Overflow
I have a value in Java that is always null but I don't understand why, because I am setting the value of the...
Read more >Code Inspection: Expression is always 'null' - PhpStorm
Code Inspection: Expression is always 'null' Reports the variables in return statements that are always null . In the following example, the $ ......
Read more >Value always null | Blazor Forums - Syncfusion
</SfAutoComplete>. This is my current setup but the value is always Null whatever I select. Also how do I set the initial selected...
Read more >Why is value always null when using Sitecore Forms with a ...
I'm using a custom validator for ReCaptcha on Sitecore forms . I've followed all of the instructions in the Sitecore docs for creating...
Read more >SQL NULL Values - IS NULL and IS NOT NULL - W3Schools
A field with a NULL value is a field with no value. If a field in a table is optional, it is possible...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yeah - so the value prop,
schedulesTimes
, is an array of objects, right? the component expects avalue
attribute for each object which contains the date. The onClick callback gets passed thevalue
attribute of that particular day - so if you don’t have an object for that day,value
will be null.Currently, if you want to get a non-null value for every square, you’ll have to add all the days in the range to the
values
prop in order to have onClick get the right value, e.g.:I was considering adding a second parameter to onClick to provide the date clicked even if value wasn’t provided, so that the
values
array can be sparse in this use case, but wasn’t sure it was worth making the API more complicated. I’m open to that idea.I don’t think that adding a second argument is a bad idea.
Right now the API provides no way for the code to detect which empty square was clicked, when an empty square is clicked.
I can definitely see a second argument in the
onClick
handler being extremely useful, e.g. when trying to add new information for a particular date.