ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.05k stars 14.64k forks source link

[Bug Report] Number input Setter and change event not getting triggered on keyboard inputs. it only happens on focus blur or using the control buttons #22235

Open albertkur opened 1 year ago

albertkur commented 1 year ago

Element UI version

2.15.10

OS/Browsers version

macOS Ventura / Chrome, firefox & safari

Vue version

2.7.13

Reproduction Link

https://codepen.io/Albert-Kurian/pen/LYrRVRO?editors=1111

Steps to reproduce

Type in a number into the element number input field using keyboard and then type in a number into the native number input field

What is Expected?

The value setter should get called and change event should be fired.

What is actually happening?

setter was not getting called and change handler was not triggered for element number input until the field lose focus, or the control buttons are used. but native input field updates the value with every key press.

little-huang commented 1 year ago

The alternative approach would be to watch the value of "num" and trigger the "handleChange" event accordingly.