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

InputNumber's changeOnWheel props ignored when type is number #48695

Closed
devops3199 opened this issue Apr 29, 2024 · 7 comments · Fixed by #48714
Closed

InputNumber's changeOnWheel props ignored when type is number #48695

devops3199 opened this issue Apr 29, 2024 · 7 comments · Fixed by #48714

Comments

@devops3199
Copy link

Reproduction link

https://ant.design/components/input-number#input-number-demo-change-on-wheel

Steps to reproduce

try the code below.

<InputNumber type="number" min={1} max={10} defaultValue={3} onChange={onChange} changeOnWheel={false} />

What is expected?

A wheel action should be ignored when type is number and changeOnWheel is false.

What is actually happening?

A wheel action is still applied when type is number.

Environment Info
antd 5.16.5
React 17.0.2
System M1
Browser Chrome 120.0.6099.109
@wanpan11
Copy link
Contributor

The InputNumber component is working properly, which should be an issue with the editor on the official website 🧐

@devops3199
Copy link
Author

I'm afraid that the issue has arisen in my local.

@wanpan11
Copy link
Contributor

wanpan11 commented Apr 30, 2024

https://stackblitz.com/edit/react-zbmzv8-ikvn43?file=demo.tsx

Can you provide your example

@devops3199
Copy link
Author

https://stackblitz.com/edit/react-zbmzv8-pxass1?file=demo.tsx

I added type attribute.

@wanpan11
Copy link
Contributor

The problem is caused by type="number", removing the type is normal. I will explain this issue in the document later 🧐

@devops3199
Copy link
Author

https://stackblitz.com/edit/react-zbmzv8-4pcc6d?file=demo.tsx

Even just <Input type="number" /> does not work with changeOnWheel props. As a vanilla html input tag does not allow wheel actions, it's better to take this as a bug.

@wanpan11
Copy link
Contributor

wanpan11 commented May 3, 2024

Vanilla input adds type="number" mouse wheel events are supported by default in Chrome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants