Do not warn if `touch.force` is NaN

Reviewed By: jingc

Differential Revision: D4956972

fbshipit-source-id: e0d4d55e4e7ee352a8fc88a4cfd43dc3cabc9c48
This commit is contained in:
Valentin Shergin 2017-04-26 15:13:04 -07:00 committed by Facebook Github Bot
parent 19e1ef9042
commit 91be5bfc86
1 changed files with 1 additions and 1 deletions

View File

@ -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));
}
}