Skip to content

Commit

Permalink
Fix EventAnimationDriverMatchSpec to match non-bubbling pointer events
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[Android][Internal] - Fix EventAnimationDriverMatchSpec to match against the view that generated the event for non-bubbling pointer events. This should have no effect if you are not using PointerEvents

Reviewed By: mdvacca

Differential Revision: D43413771

fbshipit-source-id: 31ac751b3d3d55eb44d3a9ab54e5fb387dcaa9b3
  • Loading branch information
genkikondo authored and OlimpiaZurek committed May 22, 2023
1 parent 53ebb72 commit dc98ab0
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,21 @@ public Event.EventAnimationDriverMatchSpec getEventAnimationDriverMatchSpec() {
new EventAnimationDriverMatchSpec() {
@Override
public boolean match(int viewTag, String eventName) {
if (!eventName.equals(mEventName) || !PointerEventHelper.isBubblingEvent(eventName)) {
if (!eventName.equals(mEventName)) {
return false;
}

List<TouchTargetHelper.ViewTarget> viewTargets =
mEventState.getHitPathForActivePointer();
for (TouchTargetHelper.ViewTarget viewTarget : viewTargets) {
if (viewTarget.getViewId() == viewTag) {
return true;
if (PointerEventHelper.isBubblingEvent(eventName)) {
for (TouchTargetHelper.ViewTarget viewTarget :
mEventState.getHitPathForActivePointer()) {
if (viewTarget.getViewId() == viewTag) {
return true;
}
}
return false;
} else {
return getViewTag() == viewTag;
}
return false;
}
};
}
Expand Down

0 comments on commit dc98ab0

Please sign in to comment.