Skip to content

fix: 修复导致 swiper item 重叠的问题(#5354)#5912

Open
tofrankie wants to merge 1 commit intodcloudio:nextfrom
tofrankie:next
Open

fix: 修复导致 swiper item 重叠的问题(#5354)#5912
tofrankie wants to merge 1 commit intodcloudio:nextfrom
tofrankie:next

Conversation

@tofrankie
Copy link

关联 issue:#5354 (comment)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical null reference bug in App platform components that use the useRebuild callback. The issue (#5354) originally manifested in the swiper component where slideFrameRef.value was null when accessed during rebuild, causing errors and swiper-item overlap. This PR extends the fix pattern to other components that have the same vulnerability.

Changes:

  • Add null safety checks for ref values in useRebuild callbacks to prevent null reference errors
  • Ensures components can handle early callback invocation before DOM elements are attached to refs
  • Maintains consistency with the fix pattern already established in swiper and picker-view components

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/uni-components/src/vue/movable-area/index.tsx Adds null check for rootRef.value before accessing its children property in the useRebuild callback
packages/uni-app-plus/src/view/components/cover-view/index.tsx Adds null check for textRef.value before accessing its childNodes in the useRebuild callback

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants