Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/base/b-list/b-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужен комментарий почему так сделано + тесты и changelog

.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] */
Expand Down Expand Up @@ -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);

Expand Down