diff --git a/packages/webpack-plugin/lib/runtime/components/react/mpx-movable-view.tsx b/packages/webpack-plugin/lib/runtime/components/react/mpx-movable-view.tsx index 660f9cc66..c782906bc 100644 --- a/packages/webpack-plugin/lib/runtime/components/react/mpx-movable-view.tsx +++ b/packages/webpack-plugin/lib/runtime/components/react/mpx-movable-view.tsx @@ -145,7 +145,7 @@ const _MovableView = forwardRef, MovableViewP const nodeRef = useRef(null) useNodesRef(props, ref, nodeRef, { - defaultStyle: normalStyle, + defaultStyle: styles.container, gestureRef: movableGestureRef }) diff --git a/packages/webpack-plugin/lib/runtime/components/react/mpx-scroll-view.tsx b/packages/webpack-plugin/lib/runtime/components/react/mpx-scroll-view.tsx index ac3a95def..0c3aeb7a5 100644 --- a/packages/webpack-plugin/lib/runtime/components/react/mpx-scroll-view.tsx +++ b/packages/webpack-plugin/lib/runtime/components/react/mpx-scroll-view.tsx @@ -283,18 +283,12 @@ const _ScrollView = forwardRef, S } function onContentSizeChange (width: number, height: number) { - scrollOptions.current = { - ...scrollOptions.current, - contentLength: selectLength({ height, width }) - } + scrollOptions.current.contentLength = selectLength({ height, width }) } function onLayout (e: LayoutChangeEvent) { const layout = e.nativeEvent.layout || {} - scrollOptions.current = { - ...scrollOptions.current, - visibleLength: selectLength(layout) - } + scrollOptions.current.visibleLength = selectLength(layout) } function updateScrollOptions (e: NativeSyntheticEvent, position: Record) { @@ -443,11 +437,9 @@ const _ScrollView = forwardRef, S ref: scrollViewRef, onScroll: onScroll, onContentSizeChange: onContentSizeChange, - ...(enhanced && { - ...(binddragstart && { bindtouchstart: onScrollTouchStart }), - ...(binddragging && { bindtouchmove: onScrollTouchMove }), - ...(binddragend && { bindtouchend: onScrollTouchEnd }) - }), + bindtouchstart: onScrollTouchStart, + bindtouchmove: onScrollTouchMove, + bindtouchend: onScrollTouchEnd, onScrollBeginDrag: onScrollDrag, onScrollEndDrag: onScrollDrag, onMomentumScrollEnd: onScrollEnd,