Skip to content
Open
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
6 changes: 4 additions & 2 deletions projects/element-ng/modal/si-modal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
viewChild,
DOCUMENT
} from '@angular/core';
import { areAnimationsDisabled } from '@siemens/element-ng/common';

import { ModalRef } from './modalref';

Expand All @@ -26,7 +27,8 @@ import { ModalRef } from './modalref';
changeDetection: ChangeDetectionStrategy.OnPush
})
export class SiModalComponent implements OnInit, AfterViewInit, OnDestroy {
protected modalRef = inject(ModalRef<unknown, any>);
protected readonly modalRef = inject(ModalRef<unknown, any>);
protected readonly isAnimated = !areAnimationsDisabled() && this.modalRef.data.animated !== false;

protected dialogClass = this.modalRef.dialogClass ?? '';
protected titleId = this.modalRef.data?.ariaLabelledBy ?? '';
Expand Down Expand Up @@ -135,6 +137,6 @@ export class SiModalComponent implements OnInit, AfterViewInit, OnDestroy {
}

private animationTime(millis: number): number {
return this.modalRef?.data.animated !== false ? millis : 0;
return this.isAnimated ? millis : 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need still need to respect data.animated.

@dr-itz do you think we can deprecate the animated property with this change? Was there a specific use case why this was introduced?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is respected in line 31

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I don't really remember, but I guess this was for ngx-bootstrap compatibility. So yeah, having this here feels kinda pointless

}
}
Loading