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

fix(core): relative position property for Dynamic Page #11678

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libs/core/dynamic-page/dynamic-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[class.fd-dynamic-page--transparent-bg]="background === 'transparent'"
[class.fd-dynamic-page--list-bg]="background === 'list'"
[attr.aria-label]="ariaLabel"
[style.position]="positionRelative ? 'relative' : null"
>
<header class="fd-dynamic-page__header" [class.fd-dynamic-page__header--not-collapsible]="!_headerCollapsible">
<div>
Expand Down
6 changes: 6 additions & 0 deletions libs/core/dynamic-page/dynamic-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ export class DynamicPageComponent implements AfterViewInit, DynamicPage {
*/
@Input() expandContent = true;

/**
* Whether dynamic page has position relative.
* This is needed in cases where Dynamic Page is used in Flexible Column Layout and has a floating footer
*/
@Input() positionRelative = false;

/** @hidden reference to header component */
@ContentChild(DynamicPageSubheaderComponent)
_pageSubheaderComponent: DynamicPageSubheaderComponent;
Expand Down
6 changes: 5 additions & 1 deletion libs/docs/core/dynamic-page/dynamic-page-docs.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
<separator></separator>

<fd-docs-section-title id="layout" componentName="dynamic-page">
Dynamic Page inside Column Layout
Dynamic Page inside Flexible Column Layout
</fd-docs-section-title>
<description>
If Dynamic Page has a floating footer you need to add <code>[positionRelative]="true"</code> so that the footer only
occupies the width of the column within the Flexible Column Layout.
</description>
<component-example>
<fd-dynamic-page-column-layout-example></fd-dynamic-page-column-layout-example>
</component-example>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
(layoutChange)="changeLayout($event)"
>
<ng-template #startColumn>
<fd-dynamic-page [autoResponsive]="true" ariaLabel="Example Dynamic Page">
<fd-dynamic-page [autoResponsive]="true" ariaLabel="Example Dynamic Page" [positionRelative]="true">
<fd-dynamic-page-header
title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"
subtitle="sed do eiusmod tempor incididunt ut labore et dolore magna aliqua"
Expand Down
Loading