-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose combo filtering strategy 14.0.x #11844
Conversation
# Conflicts: # projects/igniteui-angular/src/lib/combo/combo.common.ts # projects/igniteui-angular/src/lib/combo/combo.component.html
# Conflicts: # projects/igniteui-angular/src/lib/combo/combo.common.ts
# Conflicts: # CHANGELOG.md
@@ -875,13 +894,29 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement | |||
protected destroy$ = new Subject<any>(); | |||
protected _onTouchedCallback: () => void = noop; | |||
protected _onChangeCallback: (_: any) => void = noop; | |||
protected _defaultFilterFunction = (collection: any[], searchValue: any, matchCase: boolean): any[] => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define the default filtering function in the pipe and pass it as a default value for the transform
method filterFunction
parameter. This way when your combo input filterFunction
is undefined, the default logic will be applied.
* ``` | ||
*/ | ||
@Input() | ||
public get filterFunction(): (collection: any[], searchValue: any, caseSensitive: boolean) => any[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You no longer need a get and a set as well as a private variable!
|
||
public transform( | ||
collection: any[], | ||
filterFunction: (collection: any[], searchValue: any, caseSensitive: boolean) => any[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to the end and assign it in the function definition to _defaultFilterFunction
Closes #9884
Closes #11532
Closes #11810
Additional information (check all that apply):
Checklist:
feature/README.MD
updates for the feature docsREADME.MD
CHANGELOG.MD
updates for newly added functionalityng update
migrations for the breaking changes (migrations guidelines)