Skip to content

Commit

Permalink
Fix mixBlendMode not updating on Image state updates (#46680)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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

fbshipit-source-id: 0eb15520f1087e25683853632943e64a66344481
  • Loading branch information
jorge-cab authored and facebook-github-bot committed Sep 30, 2024
1 parent d2c48f3 commit fae572d
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 fae572d

Please sign in to comment.