1

Got one question, when I use the pasted text inside the search cell, the filter doesn't work. But if you type the text, it will work. And also, if you use pasted text after typing or deleting anything, it will start to work. (for example: copy john and paste into the 'Tenant Name' cell).

Following is the link: https://stackblitz.com/edit/angular-vq21ey?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.module.ts

Thank you in advance!

sparky
  • 13
  • 3

1 Answers1

0

If you set the filterPredicate first before the filter, I think it will work for you, so just switch these two lines:

  this.dataSource.filterPredicate = this.createFilter();
  this.dataSource.filter = JSON.stringify(this.filterValues);
BizzyBob
  • 12,309
  • 4
  • 27
  • 51
  • Wow, thank you very much! It works. So, we need to assign the createFilter() to filterPredicate first, then update the value. – sparky Oct 20 '22 at 16:52