Can't dynamically add bounds
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, react, typescript
- Domain
- frontend
Research direction
Start by running the provided CarSlider reproduction and inspect the Range behavior when its controlled value and min/max bounds change together. Trace the relevant range and tooltip handling, then verify the expected handle and tooltip movement with dynamic bounds. Done means the reproduction behaves like the hard-coded-bound case, with a regression test or documented verification for the dynamic case.
Written by the indexing model from the issue text.
Description
Maybe it's a bug in a library or something because the problem is fairly simple. I just need min and max values added dynamically. Here is the minimum working example of the implementation:
const CarSlider = () => {
const [defaultValues, setDefaultValues] = useState([800, 1000]);
const onChange = defaultValues => {
setDefaultValues(defaultValues);
};
return (
<div className='range-alignment'>
<div className='range-text'>
<p>Preisklasse</p>
<p className='range-price'>
{defaultValues[0]}€ - {defaultValues[1]}€
</p>
</div>
<div className='range-btn-align'>
<div className='range-width'>
<Range
defaultValue={[defaultValues[0], defaultValues[1]]}
value={[defaultValues[0], defaultValues[1]]}
allowCross={false}
range
tipFormatter={value => `${value}`}
tipProps={{ visible: true }}
min={defaultValues[0]}
max={defaultValues[1]}
onChange={onChange}
/>
</div>
<button className='range-button'>Filter</button>
</div>
</div>
);
};
export default CarSlider;
In the code above values change but the two tooltips dont move with the cursor. When hardcoding the values min={800} and max={1000} everything works as it should. I double-checked the typeof both defaultValues and they are numbers which is appropriate data type for min and max. I need these values to not be hard-coded.
- Dominant language
- TypeScript
- Stars
- 3.1k
- Forks
- 766
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from react-component/slider
-
Docs site is brokenOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
react-component/slider#1067 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
react-component/slider#1064 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
react-component/slider#1061 ·
-
当Slider宽度超过外层容器时,点击Slider,滚动条位置异常Possibly taken @nrps9909 claimed this 44 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
react-component/slider#1060 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
react-component/slider#1058 · 1 comment ·
All issues in react-component/slider
Similar issues
-
area/frontend area/v2 kind/bug priority/needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
kubeflow/notebooks#1498 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
P1
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
SuruchBoss/Cwork#90 ·
-
bug cli service
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
521xueweihan/HelloGitHub#3922 ·