Skip to content

calendar: CalendarTooltip doesn't support valueFormat #2812

@kamranayub

Description

@kamranayub

Describe/explain the bug

When using Calendar or TimeRange, you can provide a valueFormat function:

(v: number) => string;

In CalendarTooltip.tsx, value is assumed to always be a number:

if (value === undefined || isNaN(Number(value))) return null

This will return null when using a valueFormat function because it returns a string, not a number, which fails to show a tooltip.

To Reproduce

https://codesandbox.io/p/sandbox/mystifying-dhawan-4qhh8x

Steps to reproduce the behavior:

  1. Go to csb
  2. Hover or try to click on time range day
  3. Observe no tooltip is shown

Expected behavior

A tooltip should be shown

Workaround

Copy original tooltip and make your own without the isNaN check

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions