Skip to content

Commit

Permalink
fix(select-setting): fix options processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Sisha0 committed Nov 22, 2021
1 parent 3acb8ec commit bc9c8b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/settings/select-setting/select-setting.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import {attr, boolAttr} from '@exadel/esl/modules/esl-base-element/core';
import type {ESLSelect} from '@exadel/esl/modules/esl-forms/esl-select/core';
import {randUID} from '@exadel/esl/modules/esl-utils/misc/uid';
import {memoize} from '@exadel/esl/modules/esl-utils/decorators/memoize';

import {UIPSetting} from '../setting';
import {ChangeAttrConfig, UIPStateModel} from '../../../../../core/base/model';
import TokenListUtils from '../../../../../utils/token-list-utils';
import {WARNING_MSG} from '../../../../../utils/warning-msg';
import {UIPSetting} from '../setting/setting';
import {ChangeAttrConfig, UIPStateModel} from '../../core/base/model';
import TokenListUtils from '../../utils/token-list-utils';
import {WARNING_MSG} from '../../utils/warning-msg';

/**
* Custom setting for selecting attribute's value.
Expand All @@ -30,7 +29,6 @@ export class UIPSelectSetting extends UIPSetting {
/** Select field to change setting's value. */
protected $field: ESLSelect;

@memoize()
protected get settingOptions(): string[] {
return this.$field.options.map(opt => opt.value);
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/token-list-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class TokenListUtils {
static intersection<T>(...rest: T[][]): T[];
static intersection<T>(a: T[], b: T[], ...rest: T[][]): T[] {
if (rest.length) return TokenListUtils.intersection(a, TokenListUtils.intersection(b, ...rest));
return a.filter(Set.prototype.has, new Set(b));
return b ? a.filter(Set.prototype.has, new Set(b)) : a;
}

/** Remove all element appearances from array. */
Expand Down

0 comments on commit bc9c8b8

Please sign in to comment.