Skip to content

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

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

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

Conversation

@tofrankie
Copy link
Copy Markdown

关联 issue:#5354 (comment)

Copy link
Copy Markdown

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.

@StrivingRabbit StrivingRabbit deleted the branch dcloudio:next March 19, 2026 08:16
StrivingRabbit pushed a commit that referenced this pull request Mar 20, 2026
Merge pull request #5912 from tofrankie/next

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@StrivingRabbit
Copy link
Copy Markdown
Collaborator

已合并至 uni-app-vue3-dev 分支

@tofrankie
Copy link
Copy Markdown
Author

谢谢

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.

3 participants