-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(collapse): respect display input value
This change removes race conditions caused by TypeScript setters being called by Angular in non-deterministic order. Setters side effects (reading values set in other setters) are moved to ngOnChanges lifecycle hook. The consequence is that those side effects are no longer called when those inputs are set other than in the template. This is a breaking change but methods to call instead of setting those properties are already provided (show/hide) so migration path is straightforward. Setting display to 'none' no longer hides the collapse, setting collapse input to true or calling hide method is the way to go. BREAKING CHANGE: setting display or collapse property on CollapseDirective no longer expands/collapses the collapse - use show/hide methods instead or set collapse input in template
- Loading branch information
1 parent
2c671b6
commit f7a37ef
Showing
2 changed files
with
19 additions
and
28 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
.../ngx-bootstrap-docs/src/app/components/+collapse/demos/inline-display/inline-display.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<button type="button" class="btn btn-success" (click)="collapse.display='inline-block'" | ||
<button type="button" class="btn btn-success" (click)="isCollapsed = false" | ||
aria-controls="collapseBasic">Inline-block | ||
</button> | ||
<button type="button" class="btn btn-primary" (click)="collapse.display='none'" | ||
<button type="button" class="btn btn-primary" (click)="isCollapsed = true" | ||
aria-controls="collapseBasic">None | ||
</button> | ||
<hr> | ||
<div id="collapseBasic" [collapse]="!isCollapsed" #collapse="bs-collapse"> | ||
<div id="collapseBasic" [collapse]="isCollapsed" [display]="'inline-block'"> | ||
<div class="well well-lg card card-block card-header">Some content</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters