ionic-pullup
ionic-pullup copied to clipboard
Dynamic [minBottomVisible] causes "changes.state is undefined"
Hi,
I'm trying to make a dynamic pullup that will fit (in collapsed state) the remaining space after an img's src has loaded (it can take at least a few seconds). Currently I'm simply assigning minBottomVisible to a variable that changes when load event of img is fired.
HTML
<ion-content id="content-img">
<div height="70%" id="imgDiv" #img>
<img height="100%" [src]="this.imgSrc" (load)="ImgHasLoaded()">
</div>
</ion-content>
<lib-ionic-pullup (onExpand)="footerExpanded()" (onCollapse)="footerCollapsed()" [(state)]="footerState"
[toolbarTopMargin]="100" [minBottomVisible]="this.height">
<ion-toolbar id="toolbar-pullup" (click)="toggleFooter()">
<div class="handle">
<div class="bar">
</div>
</div>
</ion-toolbar>
<ion-content>
</ion-content>
</lib-ionic-pullup>
height = 150;
footerState: IonPullUpFooterState;
constructor(){
this.footerState = IonPullUpFooterState.Collapsed;
}
ImgHasLoaded(){
this.height = window.innerHeight - this.img.nativeElement.clientHeight
}
Unfortunately, it causes an error:
ERROR TypeError: "changes.state is undefined"
@ ngOnChanges ionic-pullup.js:357
Any ideas ?
Version is ionic/angular 5.1.0
Hi @SENAHK, thanks for reporting this. To be honest, I haven't tested on Ionic 5 yet. I'm currently a bit overwhelmed but I'll try to look into it in the next week(s). Sorry if you needed quick response times but I'm a one-man show 😆
Hey, no worries ! Thanks for your work, this ionic-pullup is very useful I must say !