private _computeDisplayedOptions()

in desktop/src/@batch-flask/ui/select/select.component.ts [448:471]


    private _computeDisplayedOptions() {
        const options = [];
        let focusedOptionIncluded = false;
        this.options.forEach((option) => {
            const label = option.label && option.label.toLowerCase();
            if (!this.filter
                || label.contains(this.filter.toLowerCase())) {
                options.push(option);

                if (option === this.focusedOption) {
                    focusedOptionIncluded = true;
                }
            }
        });
        this.displayedOptions = options;

        // If the filter makes it that we don't see the currently focusesd option fallback to focussing the first item
        if (!focusedOptionIncluded && this.dropdownOpen && this.filterable && this.filter) {
            this.focusFirstOption();
        } else {
            this._keyNavigator.items = options;
        }
        this.changeDetector.markForCheck();
    }