@@ -44,6 +44,7 @@ const InternalPickerRoller: ForwardRefRenderFunction<
44
44
const isMoving = useRef ( false )
45
45
const rollerRef = useRef < any > ( null )
46
46
const pickerRollerRef = useRef < any > ( null )
47
+ const placeholderRef = useRef ( null )
47
48
const [ startTime , setStartTime ] = useState ( 0 )
48
49
const [ startY , setStartY ] = useState ( 0 )
49
50
const transformY = useRef ( 0 )
@@ -157,7 +158,7 @@ const InternalPickerRoller: ForwardRefRenderFunction<
157
158
158
159
const getReactHeight = async ( ) => {
159
160
try {
160
- const placeholder = await getRectByTaro ( rollerRef . current )
161
+ const placeholder = await getRectByTaro ( placeholderRef . current )
161
162
const placeholderHeight = placeholder . height || 0
162
163
return placeholderHeight
163
164
} catch ( error ) {
@@ -187,7 +188,7 @@ const InternalPickerRoller: ForwardRefRenderFunction<
187
188
}
188
189
} )
189
190
}
190
- } , [ pickerRollerRef . current , rollerRef . current ] )
191
+ } , [ pickerRollerRef . current , placeholderRef . current ] )
191
192
192
193
useEffect ( ( ) => {
193
194
isMoving . current = false
@@ -246,6 +247,11 @@ const InternalPickerRoller: ForwardRefRenderFunction<
246
247
247
248
return (
248
249
< View className = "nut-pickerview-list" ref = { pickerRollerRef } >
250
+ < View
251
+ className = { `${ classPrefix } -placeholder` }
252
+ ref = { placeholderRef }
253
+ id = { `${ classPrefix } -placeholder-${ uuid } ` }
254
+ />
249
255
< View
250
256
className = { classPrefix }
251
257
id = { `${ classPrefix } -${ uuid } ` }
0 commit comments