mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
Merge pull request #2476 from DSpace/backport-2432-to-dspace-7_x
[Port dspace-7_x] Fix to Value of dropdown changes automatically on item submission page
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
|
||||
<button class="dropdown-item disabled" *ngIf="optionsList && optionsList.length == 0">{{'form.no-results' | translate}}</button>
|
||||
<button class="dropdown-item collection-item text-truncate" *ngFor="let listEntry of optionsList"
|
||||
(click)="onSelect(listEntry); sdRef.close()" (mousedown)="onSelect(listEntry); sdRef.close()"
|
||||
(keydown.enter)="onSelect(listEntry); sdRef.close()" (mousedown)="onSelect(listEntry); sdRef.close()"
|
||||
title="{{ listEntry.display }}" role="option"
|
||||
[attr.id]="listEntry.display == (currentValue|async) ? ('combobox_' + id + '_selected') : null">
|
||||
{{inputFormatter(listEntry)}}
|
||||
|
@@ -159,14 +159,15 @@ describe('Dynamic Dynamic Scrollable Dropdown component', () => {
|
||||
let de: any = scrollableDropdownFixture.debugElement.query(By.css('input.form-control'));
|
||||
let btnEl = de.nativeElement;
|
||||
|
||||
btnEl.click();
|
||||
const mousedownEvent = new MouseEvent('mousedown');
|
||||
|
||||
btnEl.dispatchEvent(mousedownEvent);
|
||||
scrollableDropdownFixture.detectChanges();
|
||||
|
||||
de = scrollableDropdownFixture.debugElement.queryAll(By.css('button.dropdown-item'));
|
||||
btnEl = de[0].nativeElement;
|
||||
|
||||
btnEl.click();
|
||||
|
||||
btnEl.dispatchEvent(mousedownEvent);
|
||||
scrollableDropdownFixture.detectChanges();
|
||||
|
||||
expect((scrollableDropdownComp.model as any).value).toEqual(selectedValue);
|
||||
|
Reference in New Issue
Block a user