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

Commit

Permalink
Merge pull request #1854 from mahaiyannn/iOS-bugfix-active_pseudo
Browse files Browse the repository at this point in the history
[iOS] [BugFix] Fix remove active pseudo class doesn't work.
  • Loading branch information
wqyfavor committed Dec 17, 2018
2 parents eacde9e + 16c657b commit 63c4f4d
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 @@ -681,6 +681,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 63c4f4d

Please sign in to comment.