[Scroll] Include content insets in scroll events
Summary: When calculating how far the user has scrolled, it is necessary to know the content insets where: number of pixels scrolled = content offset + leading content inset for the scroll axis This diff adds the contentInset field to native scroll events. Closes https://github.com/facebook/react-native/pull/737 Github Author: James Ide <ide@jameside.com> Test Plan: Imported from GitHub, without a `Test Plan:` line.
This commit is contained in:
parent
fcc87916d2
commit
20d95ed129
|
@ -97,6 +97,12 @@ RCT_IMPORT_METHOD(RCTEventEmitter, receiveEvent);
|
|||
@"x": @(scrollView.contentOffset.x),
|
||||
@"y": @(scrollView.contentOffset.y)
|
||||
},
|
||||
@"contentInset": @{
|
||||
@"top": @(scrollView.contentInset.top),
|
||||
@"left": @(scrollView.contentInset.left),
|
||||
@"bottom": @(scrollView.contentInset.bottom),
|
||||
@"right": @(scrollView.contentInset.right)
|
||||
},
|
||||
@"contentSize": @{
|
||||
@"width": @(scrollView.contentSize.width),
|
||||
@"height": @(scrollView.contentSize.height)
|
||||
|
|
Loading…
Reference in New Issue