Skip to content

Commit

Permalink
Allow filters to be cleared
Browse files Browse the repository at this point in the history
We need to allow empty setting empty filters too. So that a filter can be cleared.
Consider this:
```
<SymbolLayer filter={this.state.filter} ...>
```
Where filter changes from `nil` to `non-nil` then to `nil` again. The removed `if` statement prevents resetting the filter to nil.

react-native-mapbox-gl/maps@3b03f64#diff-79220b28bb9c8c50280ea315ef9a4f9cR81
  • Loading branch information
mfazekas authored Oct 14, 2019
1 parent 0328a4f commit f530005
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ios/RCTMGL/RCTMGLLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ - (void)setFilter:(NSArray *)filter

if (_styleLayer != nil) {
NSPredicate *predicate = [self buildFilters];
if (predicate) {
[self updateFilter:predicate];
}
[self updateFilter:predicate];
}
}

Expand Down

0 comments on commit f530005

Please sign in to comment.