Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dialog, Form]: Unify Dialog's header and footer positions when content includes Form Component #485

Merged
merged 11 commits into from
Nov 18, 2024
Prev Previous commit
Next Next commit
DS-376: Move ErrorSummary inside scrollable content if Form is inside…
… Dialog
RiinaKuu committed Nov 15, 2024
commit 78ba95bc0d62e003a02c2f7abfff919ff47f66ef
Original file line number Diff line number Diff line change
@@ -110,8 +110,12 @@
max-height: inherit;
}

/* Make Form content scrollable when inside Dialog. Same styles can be found in MatDialogContent directive */
/* Make Form content scrollable when inside Dialog */
.fudis-form__content {
/* Necessary padding for content if ErrorSummary appears, otherwise its visible focus is cropped from the top */
padding-top: spacing.$spacing-xxs;

/* These styles can be found in MatDialogContent directive which enables scrollable content */
max-height: 65vh;
overflow: auto;
}
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@
<ng-container *ngTemplateOutlet="_headerContent!.templateRef" />
</div>
</ng-container>
<ng-container *ngIf="_formElement !== undefined && errorSummaryVisible">
<ng-container *ngIf="_formElement !== undefined && errorSummaryVisible && !_dialogParent">
<fudis-error-summary
[formId]="id"
[parentComponent]="_formElement"
@@ -69,6 +69,13 @@
</ng-container>
<ng-container *ngIf="_mainContent?.type === 'form'">
<div class="fudis-form__content">
<ng-container *ngIf="_formElement !== undefined && errorSummaryVisible && _dialogParent">
<fudis-error-summary
[formId]="id"
[parentComponent]="_formElement"
[helpText]="errorSummaryHelpText"
/>
</ng-container>
<ng-container *ngTemplateOutlet="_mainContent!.templateRef" />
</div>
</ng-container>