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
.open() does nothing if there is a transition running, otherwise runs a new opening transition
.close() stops currently running transition on an element and runs a new closing transition
It's a good point about calling .open(ctx) with different contexts.
But what would you expect to happen if you open with ctx2 while in the middle of animating opening with ctx1?
Bootstrap, for example, ignores any calls while opening/closing transitions are running.
I can't recollect why it was done like this at the first place, @fbasso, do you have any comments on this?
I think this decision has been taken because of a UX design:
A user can click outside a popup while opening: it will stop the opening animation for the closing one
A user close the popup: there is no action on his side to be done to reopen the popup during the closing animation. The same behavior as an alert for example.
I don't know if it was the right assumption to do, but as far as I remember, it was the reason.
But what would you expect to happen if you open with ctx2 while in the middle of animating opening with ctx1?
I'd expect ctx1 to no longer be part of any popover. If you need to abruptly close ctx1 to do this, that would also be okay.
And then I'd expect ctx2 to be used.
(I'd call it a regression: closing and opening in succession worked previously by default, but no longer works without changing settings. Not that the categorization is important 😄)
Bug description:
If animation is enabled,
popover.close()
and thenpopover.open()
fails to keep the popover open.Link to minimally-working StackBlitz that reproduces the issue:
https://stackblitz.com/edit/angular-q3hazv?file=src%2Fapp%2Fpopover-triggers.html
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 10.0.14
ng-bootstrap: 8.0.0
Bootstrap: 4.5.0
Discussion
Why this is a problem
It's a regression from previous version.
You can't call
.open()
twice with different contexts - you need the.close()
in between.Mitigation
Turn off animation
The text was updated successfully, but these errors were encountered: