question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing fields in interface `ValueLabelProps` in `Slider`

See original GitHub issue

The 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:

  1. Open the CodeSandbox
  2. 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
govardhan-srinivascommented, Jul 25, 2020

@oliviertassinari This is my first PR, I think I can do it. Can I claim this issue?

1reaction
oliviertassinaricommented, Jul 23, 2020

Let’s wait feedback and give priority to the author of the issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found