Skip to content

Commit 861132d

Browse files
AAwouterstdonohue
authored andcommitted
113319: Add dropdown entry to clear selection
(cherry picked from commit 13d1547b3dbf5d4cd74617d6327044da798ed44e)
1 parent a7517d6 commit 861132d

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@
4040
(scrolled)="onScroll()"
4141
[scrollWindow]="false">
4242

43-
<button class="dropdown-item disabled" *ngIf="optionsList && optionsList.length == 0">{{'form.no-results' | translate}}</button>
43+
<button class="dropdown-item disabled" *ngIf="optionsList && optionsList.length === 0">{{'form.no-results' | translate}}</button>
44+
<button class="dropdown-item collection-item text-truncate"
45+
(click)="onSelect(undefined); sdRef.close()" (mousedown)="onSelect(undefined); sdRef.close()"
46+
title="{{ 'dropdown.clear.tooltip' | translate }}" role="option"
47+
>
48+
<i>{{ 'dropdown.clear' | translate }}</i>
49+
</button>
4450
<button class="dropdown-item collection-item text-truncate" *ngFor="let listEntry of optionsList; let i = index"
4551
[class.active]="i === selectedIndex"
4652
(keydown.enter)="onSelect(listEntry); sdRef.close()" (mousedown)="onSelect(listEntry); sdRef.close()"

src/assets/i18n/en.json5

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,10 @@
14681468

14691469
"deny-request-copy.success": "Successfully denied item request",
14701470

1471+
"dropdown.clear": "Clear selection",
1472+
1473+
"dropdown.clear.tooltip": "Clear the selected option",
1474+
14711475
"dso.name.untitled": "Untitled",
14721476

14731477
"dso.name.unnamed": "Unnamed",

0 commit comments

Comments
 (0)