mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [input-number] fix binding wheel event warning (#16495)
* fix(components): [input-number] fix binding wheel event warning * remove unnecessary code --------- Co-authored-by: chibaopeng <15640244455@163.com>
This commit is contained in:
@@ -54,7 +54,6 @@
|
||||
:name="name"
|
||||
:label="label"
|
||||
:validate-event="false"
|
||||
@wheel="handleWheel"
|
||||
@keydown.up.prevent="increase"
|
||||
@keydown.down.prevent="decrease"
|
||||
@blur="handleBlur"
|
||||
@@ -294,7 +293,7 @@ const setCurrentValueToModelValue = () => {
|
||||
data.currentValue = props.modelValue
|
||||
}
|
||||
}
|
||||
const handleWheel = (e: MouseEvent) => {
|
||||
const handleWheel = (e: WheelEvent) => {
|
||||
if (document.activeElement === e.target) e.preventDefault()
|
||||
}
|
||||
|
||||
@@ -336,6 +335,7 @@ onMounted(() => {
|
||||
}
|
||||
emit(UPDATE_MODEL_EVENT, val!)
|
||||
}
|
||||
innerInput.addEventListener('wheel', handleWheel, { passive: false })
|
||||
})
|
||||
onUpdated(() => {
|
||||
const innerInput = input.value?.input
|
||||
|
||||
Reference in New Issue
Block a user