Skip to content

Commit

Permalink
Fix mixBlendMode not updating on Image state updates (facebook#46680)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#46680

Since the parent of a view with mixBlendMode prop set is the one responsible for setting the compositing of the child, when updating mixBlendMode on a child we need to also invalidate the parent.

Changelog: [Android] [Fixed] - mixBlendMode now properly does state updates

Reviewed By: joevilches

Differential Revision: D63424394
  • Loading branch information
jorge-cab authored and facebook-github-bot committed Sep 27, 2024
1 parent 1c2c38c commit 30edf0d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ public void setFilter(@NonNull T view, @Nullable ReadableArray filter) {
public void setMixBlendMode(@NonNull T view, @Nullable String mixBlendMode) {
if (ViewUtil.getUIManagerType(view) == UIManagerType.FABRIC) {
view.setTag(R.id.mix_blend_mode, BlendModeHelper.parseMixBlendMode(mixBlendMode));
// We need to trigger drawChild for the parent ViewGroup which will set the
// mixBlendMode compositing on the child
if (view.getParent() instanceof View) {
((View) view.getParent()).invalidate();
}
}
}

Expand Down

0 comments on commit 30edf0d

Please sign in to comment.