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]: Unexpected Increment Behavior in NumberInput Component with Step Prop #16865

Closed
2 tasks done
mohakgemini opened this issue Jun 25, 2024 · 1 comment · Fixed by #17048
Closed
2 tasks done

[Bug]: Unexpected Increment Behavior in NumberInput Component with Step Prop #16865

mohakgemini opened this issue Jun 25, 2024 · 1 comment · Fixed by #17048

Comments

@mohakgemini
Copy link

mohakgemini commented Jun 25, 2024

Package

@carbon/react

Browser

Chrome

Package version

v1.60.2

React version

v20.15.0

Description

When using the NumberInput component with a step prop, the increment behavior is not as expected. Specifically, when the default value is set to "1000" and the step prop is set to 1000, pressing the "+" button should increment the value to "2000". However, the value first increases to "1001" instead. Upon pressing the "+" button again, the value increments to "2001".

Also, the storybook crashes when trying to replicate the same in storybook

Expected Behavior:

  • Default value: 1000
  • step prop value: 1000
  • First press of the "+" button should set the value to 2000.
  • Subsequent presses should continue to increment the value by 1000.

Actual Behavior:

  • Default value: 1000
  • step prop value: 1000
  • First press of the "+" button sets the value to 1001.
  • Second press sets the value to 2001.

Reproduction/example

https://stackblitz.com/edit/github-mrrrn4-kvfdxe?file=src%2FApp.jsx

Steps to reproduce

  1. Set up a NumberInput component with a default value of "1000".
  2. Add a step prop with a value of 1000.
  3. Press the "+" button.

Suggested Severity

Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.

Application/PAL

No response

Code of Conduct

@guidari
Copy link
Contributor

guidari commented Jun 25, 2024

It looks like is using a lot of memory in the browser also

@2nikhiltom 2nikhiltom self-assigned this Jul 17, 2024
@2nikhiltom 2nikhiltom moved this from ⏱ Backlog to 🚦 In Review in Design System Jul 29, 2024
@github-project-automation github-project-automation bot moved this from 🚦 In Review to ✅ Done in Design System Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants