Skip to content

Commit

Permalink
Correctly reset pivot when recyling views
Browse files Browse the repository at this point in the history
Summary:
Calling `setPivotX` and `setPivotY` internally sets `isPivotExplicitlySet` in Android UI, which causes some transforms to no longer use the right transform. Instead use `resetPivot` to get the desired behaviour.

Changelog: [Android][Fixed] Bug with view transforms when view recycling is enabled

Reviewed By: NickGerleman

Differential Revision: D38579267

fbshipit-source-id: 36186286c6765f92aabaa44994546e06f34c2be0
  • Loading branch information
javache authored and facebook-github-bot committed Aug 11, 2022
1 parent 1e48274 commit e0be14a
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ protected T prepareToRecycleView(@NonNull ThemedReactContext reactContext, T vie
setTransform(view, null);

// RenderNode params not covered by setTransform above
view.setPivotX(0);
view.setPivotY(0);
view.resetPivot();
view.setTop(0);
view.setBottom(0);
view.setLeft(0);
Expand Down

0 comments on commit e0be14a

Please sign in to comment.