From 9533e7ab63283d03c01e6f4dece9537aa458dc6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Martin?= Date: Sun, 9 Jun 2019 13:15:54 +0200 Subject: [PATCH] Fixed slowness of dropdown/select with large datasets - https://github.com/edcarroll/ng2-semantic-ui/issues/403 --- src/modules/select/classes/select-base.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/select/classes/select-base.ts b/src/modules/select/classes/select-base.ts index 335a425f4..6e304931c 100644 --- a/src/modules/select/classes/select-base.ts +++ b/src/modules/select/classes/select-base.ts @@ -303,12 +303,10 @@ export abstract class SuiSelectBase implements AfterContentInit, OnDestroy this._renderedSubscriptions = []; this._renderedOptions.forEach(ro => { - // Slightly delay initialisation to avoid change after checked errors. TODO - look into avoiding this! - setTimeout(() => this.initialiseRenderedOption(ro)); - this._renderedSubscriptions.push(ro.onSelected.subscribe(() => this.selectOption(ro.value))); }); - + // Slightly delay initialisation to avoid change after checked errors. TODO - look into avoiding this! + setTimeout(() => this._renderedOptions.forEach(ro => this.initialiseRenderedOption(ro))); // If no options have been provided, autogenerate them from the rendered ones. if (this.searchService.options.length === 0 && !this.searchService.optionsLookup) { this.options = this._renderedOptions.map(ro => ro.value);