Skip to content

Commit e5585d0

Browse files
author
qzhuo
committed
fix: field组件修复连续输入卡顿问题(#724
1 parent 1a17e74 commit e5585d0

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

packages/vantui/src/field/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,8 @@ export function Field(props: FieldProps) {
116116
value: event.detail.value,
117117
})
118118
setInnerValue(event.detail || '')
119-
nextTick(() => {
120-
onInput?.(event)
121-
onChange?.(event)
122-
})
119+
onInput?.(event)
120+
onChange?.(event)
123121
}
124122

125123
const setShowClear = function (value: any) {

packages/vantui/src/transition/demo/demo1.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable */
2-
import react from 'react'
2+
import react, { useEffect } from 'react'
33
import { View } from '@tarojs/components'
44
import { Cell, Transition } from '@antmjs/vantui'
55

@@ -15,7 +15,14 @@ const animations = [
1515
'slide-right',
1616
]
1717
export default function Demo() {
18-
const [show, setShow] = react.useState('')
18+
const [show, setShow] = react.useState('fade-right')
19+
20+
useEffect(() => {
21+
setTimeout(() => {
22+
setShow('')
23+
}, 4000)
24+
}, [])
25+
1926
const animationAction = (ss) => {
2027
setShow(ss)
2128
setTimeout(() => {

0 commit comments

Comments
 (0)