Skip to content

Commit

Permalink
Fixed #14554
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Jan 24, 2024
1 parent c75c161 commit 6a5d299
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/app/components/api/translationkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ export class TranslationKeys {
public static readonly EMPTY_FILTER_MESSAGE = 'emptyFilterMessage';
public static readonly SHOW_FILTER_MENU = 'Show Filter Menu';
public static readonly HIDE_FILTER_MENU = 'Hide Filter Menu';
public static readonly SELECTION_MESSAGE = '{0} items selected';
}
7 changes: 4 additions & 3 deletions src/app/components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1407,12 +1407,13 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft

getSelectedItemsLabel() {
let pattern = /{(.*?)}/;
let message = this.selectedItemsLabel ? this.selectedItemsLabel : this.config.getTranslation(TranslationKeys.SELECTION_MESSAGE);

if (pattern.test(this.selectedItemsLabel)) {
return this.selectedItemsLabel.replace(this.selectedItemsLabel.match(pattern)[0], this.modelValue().length + '');
if (pattern.test(message)) {
return message.replace(message.match(pattern)[0], this.modelValue().length + '');
}

return this.selectedItemsLabel;
return message;
}

getOptionLabel(option: any) {
Expand Down

0 comments on commit 6a5d299

Please sign in to comment.