fix(scroll-region): top:0 or height:0 are valid for scrollToRect [sentry]

This commit is contained in:
Ben Gotow 2016-01-08 17:08:47 -08:00
parent 99f6749488
commit 373d224f0c

View file

@ -210,7 +210,7 @@ class ScrollRegion extends React.Component
scrollToRect: (rect, {position, settle, done} = {}) ->
if rect instanceof Node
throw new Error("ScrollRegion.scrollToRect: requires a rect. Maybe you meant scrollTo?")
if not rect.top or not rect.height
if not rect.top? or not rect.height?
throw new Error("ScrollRegion.scrollToRect: requires a rect with `top` and `height` attributes.")
@_scroll {position, settle, done}, => rect