From d6d91b04ab673a97f9c257815f8c76dc370d0047 Mon Sep 17 00:00:00 2001 From: Birzhan Utegenov Date: Mon, 15 Jul 2024 15:06:41 +0700 Subject: [PATCH] Fix issue1332 --- src/base/b-list/b-list.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/base/b-list/b-list.ts b/src/base/b-list/b-list.ts index d08249be58..42fc69dcbb 100644 --- a/src/base/b-list/b-list.ts +++ b/src/base/b-list/b-list.ts @@ -235,13 +235,15 @@ class bList extends iData implements iVisible, iWidth, iActiveItems { return null; }; - return this.waitStatus('ready', () => { - if (this.multiple) { - return Object.isSet(active) ? [...active].flatMap((val) => getEl(val) ?? []) : []; - } + return this.waitStatus('ready') + .then(() => this.nextTick()) + .then(() => { + if (this.multiple) { + return Object.isSet(active) ? [...active].flatMap((val) => getEl(val) ?? []) : []; + } - return getEl(active); - }); + return getEl(active); + }); } /** @see [[iActiveItems.prototype.getItemByValue] */ @@ -284,7 +286,10 @@ class bList extends iData implements iVisible, iWidth, iActiveItems { } } - SyncPromise.resolve(this.activeElement).then((selectedElement) => { + this.async.promise( + SyncPromise.resolve(this.activeElement), + {label: $$.selectActive} + ).then((selectedElement) => { const els = Array.concat([], selectedElement);