microsoft / microsoft/react-native-windows

Initial transform re-applied when View is moved

Open
#12,819 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area: View bug Old Architecture Partner: Facebook Workstream: Component Parity
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

Problem Description

XAML fires the Loaded event every time you "move" a keyed component in react-native. The reason is that you remove the XAML view from the parent's collection of children then re-add it at the new index.

Steps To Reproduce

https://snack.expo.dev/yItxPvjSwp7gqhNTAjk0s

Expected Results

Windows behavior should match the Web behavior in the Expo Snack (where after unsetting the scale transform, the unset transform behavior persists).

However, because the Loaded callback in FrameworkElementViewManager is never cleared, the transform gets re-applied :(

CLI version

npx react-native -v

Environment
npx react-native info
Target Platform Version

None

Target Device(s)

No response

Visual Studio Version

None

Build Configuration

None

Snack, code example, screenshot, or link to a repository

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with FrameworkElementViewManager and reproduce the transform behavior using the linked Expo Snack. Trace how the Loaded callback is retained when the XAML view is removed and re-added at a new index. Done means moving the keyed component no longer reapplies the initial transform, matching the Web behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, react-native
Domain
desktop-dev, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.