crystalui / lightbox

Examples of using the lightbox component.
MIT License
0 stars 0 forks source link

Preserve not changed properties on any property change #3

Closed ilianiv closed 5 years ago

ilianiv commented 5 years ago

If a property binding gets changed all other properties get lost :(

Example:

counter: boolean = true;
separator: string = ' of ';
<img [src]="image.path" height="150" lightbox [counter]="counter" [counterSeparator]="separator" />
<button (click)="counter = !counter">Toggle counter</button>

When counter changes counterSeparator will be lost because lightbox's properties will be replaced with changes from ngOnChanges() but only counter was changed so counterSeparator is missing in changes object.
See https://github.com/crystalui/angular-lightbox/blob/master/projects/crystalui/angular-lightbox/src/lib/lightbox.directive.ts#L79

ilianiv commented 5 years ago

I'm sorry the issue is for the angular project https://github.com/crystalui/angular-lightbox/issues/4