Open
Description
Summary:
When counter input set to max value, then decremented with step > minValue, first decrement is maxValue - (step - minValue)
instead of just maxValue - step
.
eg.
maxValue=1000
minValue=2
step=100
value=1000
decrement()
// value == 902 == 1000 - (100 - 2) == maxValue - (step - minValue)
- If you are working on the problem. Issues may be closed within 30 days if no one is assigned. Maintainers work on this project 20-30 hours per week and have their own prioritized backlog.
I'll likely not be working on the issue.
- How to duplicate a bug. Line numbers or code to paste into the documentation site examples is helpful.
Reproducible from the example page: https://react.lightningdesignsystem.com/components/inputs/
- Navigate to section containing: "3. CONTROLLED COUNTER INPUT WITH MIN/MAX VALUES AND CUSTOM STEP SIZE"
- Modify Example Code
- Update counter-input-3 with
<Input id="counter-input-3" label="My Label" minValue={2} maxValue={1000} onChange={(event, data) => { this.setState({ counter3value: data.value }); }} step={100} value={this.state.counter3value} variant="counter" />
- Navigate back to the relevant input.
- Set value to 1000
- Decrement
- Note resulting value is 902 instead of 900
- If you are a Salesforce employee. You should also create a duplicate work item in your internal ticket system and link to this issue.
I'll go ahead and add a ticket