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

Commit

Permalink
[iOS] [BugFix] Fix remove active pseudo class doesn't work.
Browse files Browse the repository at this point in the history
  • Loading branch information
晨燕 committed Dec 3, 2018
1 parent fe6f8c9 commit 16c657b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView {

@interface WXCycleSliderComponent () <WXRecycleSliderViewDelegate,WXIndicatorComponentDelegate>

@property (nonatomic, strong) WXRecycleSliderView *recycleSliderView;
@property (nonatomic, weak) WXRecycleSliderView *recycleSliderView;
@property (nonatomic, strong) NSTimer *autoTimer;
@property (nonatomic, assign) NSInteger currentIndex;
@property (nonatomic, assign) BOOL autoPlay;
Expand Down
1 change: 1 addition & 0 deletions ios/sdk/WeexSDK/Sources/Model/WXComponent.mm
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ - (void)_updateStylesOnComponentThread:(NSDictionary *)styles resetStyles:(NSMut
[_transition _handleTransitionWithStyles:[styles mutableCopy] resetStyles:resetStyles target:self];
} else {
styles = [self parseStyles:styles];
[self resetPseudoClassStyles:resetStyles];
[self _updateCSSNodeStyles:styles];
[self _resetCSSNodeStyles:resetStyles];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
*/
-(NSMutableDictionary *)parseStyles:(NSDictionary *)styles;

/**
* @abstract reset pseudoClassStyles.
*
*/
- (void)resetPseudoClassStyles:(NSArray *)resetstyle;

/**
* @abstract filter common styles and pseudoClassStyles.
*
Expand Down
11 changes: 11 additions & 0 deletions ios/sdk/WeexSDK/Sources/View/WXComponent+PseudoClassManagement.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ -(NSMutableDictionary *)parseStyles:(NSDictionary *)styles
return newStyles;
}

- (void)resetPseudoClassStyles:(NSArray *)resetstyle {
for (NSString* key in resetstyle) {
if([key rangeOfString:@":"].location != NSNotFound){
[_pseudoClassStyles removeObjectForKey:key];
}
}
if([_pseudoClassStyles count] == 0) {
_isListenPseudoTouch = NO;
}
}

- (void)updatePseudoClassStyles:(NSDictionary *)pseudoClassStyles
{
WXAssertMainThread();
Expand Down

0 comments on commit 16c657b

Please sign in to comment.