Skip to content

[runtime-vapor] UI does not update correctly when reactive data changes #14787

@Kaidesuyoo

Description

@Kaidesuyoo

Vue version

3.6.0-beta.10

Link to minimal reproduction

Playground

Steps to reproduce

vapor-mode.mp4

What is expected?

vDom.mp4

What is actually happening?

In Vapor mode, UI updates (v-for) behave inconsistently depending on whether list is a shallowRef or a ref.

When list is a shallowRef:

  • the update pattern used in change1 does not trigger a UI update
  • the update pattern used in change2 does not trigger a UI update

When list is a normal ref:

  • only the update pattern used in change1 fails to trigger a UI update
  • the other update patterns work as expected

The same code works correctly in the latest stable version (VDom), where all update patterns trigger UI updates normally.

System Info

System:
  OS: Windows 11 10.0.26200
Binaries:
  Node: 22.22.1
Browsers:
  Chrome: 148.0.7778.97

Additional comments

From my initial observation, the issue seems to be related to the itemRef variable inside the mount function of the apiCreateFor file.

It appears that itemRef is using the original source value returned by getItem. Later, when the data changes and the update function is called, the UI update is skipped because newItem and itemRef from the ForBlock instance still reference the same object and are therefore considered unchanged.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions