Skip to content

Commit 911cd2e

Browse files
author
NarrowsProjects
committed
chore: remove the backlog clear from setAvailable options and trim options received in the normalized setter
1 parent 319bb4d commit 911cd2e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/public/components/common/selection/SelectionModel.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ export class SelectionModel extends Observable {
260260

261261
if (this._selectionBacklog.length) {
262262
this.selectedOptions = this._selectionBacklog;
263-
this._selectionBacklog = [];
264263
this.notify();
265264
}
266265
}
@@ -355,10 +354,10 @@ export class SelectionModel extends Observable {
355354
* Sets selected options based on a comma-seperated string.
356355
* Accounts for the options being either RemoteData or an array.
357356
*
358-
* @return {string}
357+
* @param {string} value the value that is to be set.
359358
*/
360359
set normalized(value) {
361-
const options = value.split(',').map((option) => ({ value: option }));
360+
const options = value.split(',').map((option) => ({ value: option.trim() }));
362361
const postponeSelection = this.options instanceof RemoteData || ! this.options?.length;
363362

364363
if (postponeSelection) {

0 commit comments

Comments
 (0)