Skip to content
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

[Bug]: stepped option is only accepting true #1213

Open
1 task
Fabian-Anna opened this issue May 27, 2024 · 1 comment
Open
1 task

[Bug]: stepped option is only accepting true #1213

Fabian-Anna opened this issue May 27, 2024 · 1 comment
Labels

Comments

@Fabian-Anna
Copy link

Would you like to work on a fix?

  • Check this if you would like to implement a PR, we are more than happy to help you go through the process.

Current and expected behavior

When using the stepped option for a dataset, Typescript only allows true | false as a valid value despite showing the valid strings from the documentation as an option.

It should accept the options "before" | "after" | "middle" as valid options as strings.

Reproduction

https://codesandbox.io/p/devbox/compassionate-brahmagupta-npxf8t?file=%2FApp.tsx%3A52%2C16

chart.js version

v4.4.3

react-chartjs-2 version

v5.2.0

Possible solution

No response

@Fabian-Anna
Copy link
Author

Funny thing is, that it works, when one specifies the string as const, i.e.

...
stepped: 'after' as const, // leads to no error
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant