Skip to content

Commit

Permalink
Merge pull request DSpace#2933 from atmire/reset-dropdown-values
Browse files Browse the repository at this point in the history
Reset dropdown values
  • Loading branch information
tdonohue authored May 1, 2024
2 parents 0607878 + 31d3ab0 commit 0e61cfd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
[scrollWindow]="false">

<button class="dropdown-item disabled" *ngIf="optionsList && optionsList.length === 0">{{'form.no-results' | translate}}</button>
<button class="dropdown-item collection-item text-truncate"
(click)="onSelect(undefined); sdRef.close()" (mousedown)="onSelect(undefined); sdRef.close()"
title="{{ 'dropdown.clear.tooltip' | translate }}" role="option"
>
<i>{{ 'dropdown.clear' | translate }}</i>
</button>
<button class="dropdown-item collection-item text-truncate" *ngFor="let listEntry of optionsList; let i = index"
[class.active]="i === selectedIndex"
(keydown.enter)="onSelect(listEntry); sdRef.close()" (mousedown)="onSelect(listEntry); sdRef.close()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ describe('Dynamic Dynamic Scrollable Dropdown component', () => {
scrollableDropdownFixture.detectChanges();

de = scrollableDropdownFixture.debugElement.queryAll(By.css('button.dropdown-item'));
btnEl = de[0].nativeElement;
btnEl = de[1].nativeElement;

btnEl.dispatchEvent(mousedownEvent);
scrollableDropdownFixture.detectChanges();
Expand Down
4 changes: 4 additions & 0 deletions src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,10 @@

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

"dropdown.clear": "Clear selection",

"dropdown.clear.tooltip": "Clear the selected option",

"dso.name.untitled": "Untitled",

"dso.name.unnamed": "Unnamed",
Expand Down

0 comments on commit 0e61cfd

Please sign in to comment.