Skip to content

Commit 0eddaa8

Browse files
authored
fix: 修复VirtualWaterfall组件设置renderTop/Bottom后onScrollToLower/Upper无法触发的问题 (#17697)
1 parent a9dcfc1 commit 0eddaa8

File tree

1 file changed

+6
-7
lines changed
  • packages/taro-components-advanced/src/components/virtual-waterfall/react

1 file changed

+6
-7
lines changed

packages/taro-components-advanced/src/components/virtual-waterfall/react/wrapper.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,18 @@ function getRenderExpandNodes ({
2121
const props: any = {
2222
key: id,
2323
id,
24-
}
25-
if (!renderExpand) {
26-
props.style = {
24+
style: {
2725
visibility: 'hidden',
2826
height: 100,
2927
marginTop: -100,
3028
zIndex: -1,
3129
}
3230
}
33-
return React.createElement(
34-
renderExpand || innerElement,
35-
props,
36-
)
31+
const expands = [renderExpand && React.createElement(renderExpand), React.createElement(innerElement!, props)]
32+
if (direction === 'top') {
33+
expands.reverse()
34+
}
35+
return expands
3736
}
3837

3938
const outerWrapper = React.forwardRef(

0 commit comments

Comments
 (0)