Skip to content

Commit

Permalink
feat(editor): add option on custom-select
Browse files Browse the repository at this point in the history
* Adds hideLabelSelectOption option for ngx-formly custom-select.

Co-Authored-by: Bertrand Zuchuat <[email protected]>
  • Loading branch information
Garfield-fr committed Jan 30, 2024
1 parent 4e8bca2 commit c96eddf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
RERO angular core
Copyright (C) 2021-2023 RERO
Copyright (C) 2021-2024 RERO
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
Expand Down Expand Up @@ -28,7 +28,7 @@
[value]="filter" [placeholder]="'Filter…' | translate" />
</div>
<ng-container *ngIf="filteredOptions.length; else noResult">
<a *ngIf="selectedOptions.length" class="dropdown-item"
<a *ngIf="!to.hideLabelSelectOption && selectedOptions.length" class="dropdown-item"
(click)="$event.preventDefault(); selectOption(); dropdown.hide()" translate
>Select an option…</a>
<ng-container *ngFor="let option of filteredOptions">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* RERO angular core
* Copyright (C) 2021 RERO
* Copyright (C) 2021-2024 RERO
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
Expand Down Expand Up @@ -33,6 +33,7 @@ export class CustomSelectFieldComponent extends FieldType implements OnDestroy,
// Component default options
defaultOptions = {
templateOptions: {
hideLabelSelectOption: false,
minItemsToDisplaySearch: 10,
sort: true
},
Expand Down

0 comments on commit c96eddf

Please sign in to comment.