Primeng p-multiSelect 过滤器无法正常工作

Primeng p-multiSelect filter not work correct

在 html 文件中:

<p-multiSelect [filter]="true" [options]="cities1 [(ngModel)]="selectedCities1"></p-multiSelect>

在component.ts

ngOnInit() {
    this.testMultiSelect();
}

testMultiSelect() {
    interval(3000).pipe().subscribe(() => {
     this.cities1 = [
      { label: 'New York', value: { id: 1, name: 'New York', code: 'NY' } },
      { label: 'Rome', value: { id: 2, name: 'Rome', code: 'RM' } },
      { label: 'London', value: { id: 3, name: 'London', code: 'LDN' } },
      { label: 'Istanbul', value: { id: 4, name: 'Istanbul', code: 'IST' } },
      { label: 'Paris', value: { id: 5, name: 'Paris', code: 'PRS' } }
    ];
  });
}
  1. p-multiSelect加载数据后,我输入
    的输入过滤器 p-multiSelect 是 'new',过滤后 p-multiSelect 的结果是:'New 约克'.
  2. 我等待 3 秒,输入过滤器中的文本是 'new' 但 p-multiSelect 的结果是: 'New York, Rome, London, Istanbul, Paris'
  3. 预计p-multiSelect 3s后输出结果为:'New York'和文本 在输入过滤器中是 'new'。 this is image for this issue

    请帮帮我,谢谢

您设置的间隔正在重置多选过滤器。如果你删除它,它会过滤得很好。

你需要间隔吗?