Filter disabled when not returning result in notes panel

Product used: PDF.js Express Plus
Version: 8.7.1

We have to recently add new filters in Notes Panel.
I have a filter that shows printable annotations and another that shows annotations that cannot be printed.
These filters may not return any results.
When one of the filters does not return a result, the drop-down list is deactivated which prevents the selection of another filter.

filtre_pdfjs_express

Is it possible to avoid deactivating the drop-down list when a filter does not return a result ?

Thanks for your support.

Hey there,

Could you please provide a minimal sample of your project? This will allow us to debug and resolve your issue quicker.

Thank you.

Best Regards,
Darian Chen

Here are the two filters :

const filterAnnotPrintable = {
        name: 'Imprimable',
        getSortedNotes: (notes) => {
          const annotIdsPrintable = SharedCtxService.getAnnotIdsByFilter('printable', true);
          return notes.filter(note => annotIdsPrintable.some(id => id === note.Id))
        }
      };
      const filterAnnotNotPrintable = {
        name: 'Pas imprimable',
        getSortedNotes: (notes) => {
          const annotIdsNotPrintable = SharedCtxService.getAnnotIdsByFilter('printable', false);
          return notes.filter(note => annotIdsNotPrintable.some(id => id === note.Id))
        }
      };

      instance.UI.addSortStrategy(filterAnnotPrintable);
      instance.UI.addSortStrategy(filterAnnotNotPrintable);
      instance.UI.setNotesPanelSortStrategy(instance.UI.NotesPanelSortStrategy.POSITION);

And here’s the method I use to obtain printable or non-printable annotations

public getAnnotIdsByFilter(filter: string, value: any): Array<string> {
        return SharedCtxService.annotations?.filter(annot => annot[filter] === value).map(annot => annot.annotId!) || [];
    }

Thanks for your support.

Hello there,

Unfortunately, it seems it is not possible to enable the dropdown when an option does not return a result.

Best Regards,
Darian Chen