You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/06/01 07:47:24 UTC

[2/3] incubator-weex git commit: + [ios] fixbug: cycle slider

+ [ios] fixbug: cycle slider


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/00067c7d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/00067c7d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/00067c7d

Branch: refs/heads/0.14-dev
Commit: 00067c7d9a0cd75a6149af34956f29b4fb8c91a0
Parents: da396f4
Author: 齐山 <su...@163.com>
Authored: Fri May 26 18:03:48 2017 +0800
Committer: 齐山 <su...@163.com>
Committed: Fri May 26 18:03:48 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/00067c7d/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
index 3b8adf8..8e3488c 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
@@ -585,9 +585,10 @@ typedef NS_ENUM(NSInteger, Direction) {
 
 - (void)recycleSliderView:(WXRecycleSliderView *)recycleSliderView didScrollToItemAtIndex:(NSInteger)index
 {
-    self.currentIndex = index;
-    if (_sliderChangeEvent) {
+    
+    if (_sliderChangeEvent && index != self.currentIndex) {
         [self fireEvent:@"change" params:@{@"index":@(index)} domChanges:@{@"attrs": @{@"index": @(index)}}];
+        self.currentIndex = index;
     }
 }