Skip to content

Commit

Permalink
strict in ListFilterSettings is no longer overriding a custom filter …
Browse files Browse the repository at this point in the history
…function - fixes #136
  • Loading branch information
uap-universe committed Oct 23, 2023
1 parent c07e6b3 commit c43a639
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This document lists the changes introduced by this fork.

## Version 3.1.0

* The `strict` setting for `list` default filters is no longer overriding a custom provided filter function

## Version 3.0.0

* Upgrade to Angular 16
Expand Down
4 changes: 4 additions & 0 deletions projects/angular2-smart-table/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This document lists the changes introduced by this fork.

## Version 3.1.0

* The `strict` setting for `list` default filters is no longer overriding a custom provided filter function

## Version 3.0.0

* Upgrade to Angular 16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ export class SelectFilterComponent extends DefaultFilter implements OnInit {

ngOnInit() {
this.config = (this.column.filter as FilterSettings).config as ListFilterSettings;
if (this.config.strict === undefined || this.config.strict) {
this.column.filterFunction = (v, f) => v === f;
// if no filter function is provided, but filtering shall be strict, define the respective filter
const strict = this.config.strict === undefined || this.config.strict;
if (this.column.filterFunction === undefined && strict) {
this.column.filterFunction = (v, f) => v?.toString() === f;
}

const exist = this.inputControl.valueChanges;
Expand Down

0 comments on commit c43a639

Please sign in to comment.