Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[iOS] Add "isDragging" property to scroll event of a list component.
Browse files Browse the repository at this point in the history
* feature: Add "isDragging" property to scroll event of a list component.
* doc pr: apache/incubator-weex-site#361
  • Loading branch information
huanglei.hl committed Mar 28, 2019
1 parent 36dce32 commit bb1a2ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm
Original file line number Diff line number Diff line change
Expand Up @@ -718,12 +718,13 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
@"height":@(scrollView.contentSize.height / scaleFactor)};
NSDictionary *contentOffsetData = @{@"x":@(-scrollView.contentOffset.x / scaleFactor),
@"y":@(-scrollView.contentOffset.y / scaleFactor)};
NSDictionary *params = @{@"contentSize":contentSizeData, @"contentOffset":contentOffsetData, @"isDragging":@(scrollView.isDragging)};

if (_scrollStartEvent) {
[self fireEvent:@"scrollstart" params:@{@"contentSize":contentSizeData, @"contentOffset":contentOffsetData} domChanges:nil];
[self fireEvent:@"scrollstart" params:params domChanges:nil];
}
if (_scrollEventListener) {
_scrollEventListener(self, @"scrollstart", @{@"contentSize":contentSizeData, @"contentOffset":contentOffsetData});
_scrollEventListener(self, @"scrollstart", params);
}
}

Expand Down

0 comments on commit bb1a2ec

Please sign in to comment.