You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be nice if I can combine dialog [(isOpen)], @if and animations:
e.g.
@if (emailNotificationShowing) {
<igx-dialog#emailNotificationtitle="Notification"
message="Your email has been sent successfully!"
leftButtonLabel="OK"
[positionSettings]="positionSettings"
[(isOpen)]="emailNotificationShowing" <--2-waybind(leftButtonSelect)="emailNotification.close()" <--usedialogclose()></igx-dialog>
}
Why?
@if () allows for the dialog to be created on demand, rather than being allocated all the time and consuming change detection cycles.
[(isOpen)] seems convenient, but currently isOpen is set to false before the animiation plays, making the dialog destroy immediately and no animation is played.
Alternatives:
I can remove the 2-way binding and subscribe to the closed event:
@if (emailNotificationShowing) {
<igx-dialog#emailNotificationtitle="Notification"
message="Your email has been sent successfully!"
leftButtonLabel="OK"
[positionSettings]="positionSettings"
[isOpen]="true" <--alwaystrue(@ifiscontrollingtheexistencealready)(closed)="emailNotificationShowing=false" <---settofalsewhenanimationfinished(leftButtonSelect)="emailNotification.close()"
></igx-dialog>
}
The proposal here is to make isOpenChange to emit false when the animation finishes and not before it plays.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I think it would be nice if I can combine dialog
[(isOpen)]
,@if
and animations:e.g.
Why?
@if ()
allows for the dialog to be created on demand, rather than being allocated all the time and consuming change detection cycles.[(isOpen)]
seems convenient, but currently isOpen is set to false before the animiation plays, making the dialog destroy immediately and no animation is played.Alternatives:
I can remove the 2-way binding and subscribe to the closed event:
The proposal here is to make isOpenChange to emit false when the animation finishes and not before it plays.
Full example:
https://stackblitz.com/edit/mu8mffcj-4bzaa9fn?file=src%2Fapp%2Fdialog-sample-1%2Fdialog-sample-1.component.html
Related: #8320
Beta Was this translation helpful? Give feedback.
All reactions