Skip to content

Commit 636c85a

Browse files
Merge branch 'w2p-122005_fixed-dropdown-values-resetting-on-enter_contribute-7.6' into dspace-8_x
2 parents 587df79 + ed4e794 commit 636c85a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@
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" type="button" *ngIf="optionsList && optionsList.length === 0">{{'form.no-results' | translate}}</button>
4444
<button class="dropdown-item collection-item text-truncate"
4545
(click)="onSelect(undefined); sdRef.close()" (mousedown)="onSelect(undefined); sdRef.close()"
4646
title="{{ 'dropdown.clear.tooltip' | translate }}" role="option"
47-
>
47+
type="button">
4848
<i>{{ 'dropdown.clear' | translate }}</i>
4949
</button>
5050
<button class="dropdown-item collection-item text-truncate" *ngFor="let listEntry of optionsList; let i = index"
5151
[class.active]="i === selectedIndex"
5252
(keydown.enter)="onSelect(listEntry); sdRef.close()" (mousedown)="onSelect(listEntry); sdRef.close()"
53-
title="{{ listEntry.display }}" role="option"
53+
title="{{ listEntry.display }}" role="option" type="button"
5454
[attr.id]="listEntry.display === (currentValue|async) ? ('combobox_' + id + '_selected') : null">
5555
{{inputFormatter(listEntry)}}
5656
</button>

src/app/shared/form/form.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ export class FormService {
153153
}
154154

155155
public addControlErrors(field: AbstractControl, formId: string, fieldId: string, fieldIndex: number) {
156+
if (field.errors === null) {
157+
return;
158+
}
156159
const errors: string[] = Object.keys(field.errors)
157160
.filter((errorKey) => field.errors[errorKey] === true)
158161
.map((errorKey) => `error.validation.${errorKey}`);

0 commit comments

Comments
 (0)