mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-03 22:48:25 +08:00
Android shouldn't dispatch onLayout if frame didn't change
Summary: Fixes [#7202 Android Redundant onLayout event](https://github.com/facebook/react-native/issues/7202) Closes https://github.com/facebook/react-native/pull/7250 Differential Revision: D4104066 Pulled By: mkonicek fbshipit-source-id: 383efdb4b4881aa7d7e508d61c9c01165bcf7bb6
This commit is contained in:
committed by
Facebook Github Bot
parent
9833e1bd34
commit
d4b8ae7a8a
@@ -789,14 +789,16 @@ public class UIImplementation {
|
||||
|
||||
int tag = cssNode.getReactTag();
|
||||
if (!mShadowNodeRegistry.isRootNode(tag)) {
|
||||
cssNode.dispatchUpdates(
|
||||
boolean frameDidChange = cssNode.dispatchUpdates(
|
||||
absoluteX,
|
||||
absoluteY,
|
||||
mOperationsQueue,
|
||||
mNativeViewHierarchyOptimizer);
|
||||
|
||||
// notify JS about layout event if requested
|
||||
if (cssNode.shouldNotifyOnLayout()) {
|
||||
// Notify JS about layout event if requested
|
||||
// and if the position or dimensions actually changed
|
||||
// (consistent with iOS).
|
||||
if (frameDidChange && cssNode.shouldNotifyOnLayout()) {
|
||||
mEventDispatcher.dispatchEvent(
|
||||
OnLayoutEvent.obtain(
|
||||
tag,
|
||||
|
||||
Reference in New Issue
Block a user