ng-matero / extensions

Angular Material Extensions Library.
https://ng-matero.github.io/extensions/
MIT License
388 stars 48 forks source link

[mtx-select] groupBy function signature takes no argument and returns void #301

Closed okirmis closed 2 weeks ago

okirmis commented 2 weeks ago

I just noticed that the expected function signature for a function to be passed to the groupBy property of mtx-select is () => void. That seems wrong since I would expect it to take the item and return a value, e.g. something like (item: unknown) => unknown.

Looking it up, the property is just forwarded to ng-select and if I look at https://github.com/ng-select/ng-select/blob/master/src/demo/app/examples/group-function-example/group-function-example.component.ts it seems that the groupBy function should take the item and return a value.

So I would suggest to change the signature of

@Input() groupBy!: string | (() => void);

to

@Input() groupBy!: string | ((item: unknown) => unknown);
nzbin commented 2 weeks ago

17.2.2 has fixed, please have a try.