Missing fields in interface `ValueLabelProps` in `Slider`
See original GitHub issueThe interface ValueLabelProps
used in ValueLabelComponent
in Slider
only exposes these fields:
export interface ValueLabelProps extends React.HTMLAttributes<HTMLSpanElement> {
value: number;
open: boolean;
children: React.ReactElement;
}
However, there are many other props that could be used as we can see here:
<ValueLabelComponent
key={index}
valueLabelFormat={valueLabelFormat}
valueLabelDisplay={valueLabelDisplay}
className={classes.valueLabel}
value={...}
index={index}
open={...}
disabled={disabled}
>
For example, I need to use index
to have different Tooltips per index.
This is a request to extend ValueLabelProps
to include more fields (at least index
, other could be beneficial too)
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
TypeScript error Property 'index' does not exist on type 'ValueLabelProps'
Expected Behavior 🤔
No TypeScript error when using index
in a ValueLabelComponent
Steps to Reproduce 🕹
https://codesandbox.io/s/elated-johnson-ecn0b?file=/src/Demo.tsx
Steps:
- Open the CodeSandbox
- Check the TS error on the
Demo.tsx
file
Context 🔦
Just as I how in the CodeSandbox, I am trying to have a different ValueLabelComponent
for each index
(handler) of the range Slider
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | 4.9.4 |
React | ^16.12.0 |
TypeScript | ^3.9.3 |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Missing fields in interface ValueLabelProps in Slider #21889
The interface ValueLabelProps used in ValueLabelComponent in Slider only exposes these fields: export interface ValueLabelProps extends ...
Read more >Slider API - Material UI - MUI
A string value that provides a user-friendly name for the current value of the slider. classes, object. Override or extend the styles applied...
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
@oliviertassinari This is my first PR, I think I can do it. Can I claim this issue?
Let’s wait feedback and give priority to the author of the issue.