From 91be5bfc861f96175b73fe956b580a550fa0f31a Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Wed, 26 Apr 2017 15:13:04 -0700 Subject: [PATCH] Do not warn if `touch.force` is NaN Reviewed By: jingc Differential Revision: D4956972 fbshipit-source-id: e0d4d55e4e7ee352a8fc88a4cfd43dc3cabc9c48 --- React/Base/RCTTouchHandler.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/Base/RCTTouchHandler.m b/React/Base/RCTTouchHandler.m index 481128efe..dfb7fc9b4 100644 --- a/React/Base/RCTTouchHandler.m +++ b/React/Base/RCTTouchHandler.m @@ -166,7 +166,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithTarget:(id)target action:(SEL)action // should we expose a `normalTouchForce` constant somewhere (which would // have a value of `1.0 / nativeTouch.maximumPossibleForce`)? if (RCTForceTouchAvailable()) { - reactTouch[@"force"] = @(RCTSanitizeNaNValue(nativeTouch.force / nativeTouch.maximumPossibleForce, @"touchEvent.force")); + reactTouch[@"force"] = @(RCTZeroIfNaN(nativeTouch.force / nativeTouch.maximumPossibleForce)); } }