Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic [minBottomVisible] causes "changes.state is undefined" #52

Open
SENAHK opened this issue Jun 15, 2020 · 2 comments
Open

Dynamic [minBottomVisible] causes "changes.state is undefined" #52

SENAHK opened this issue Jun 15, 2020 · 2 comments

Comments

@SENAHK
Copy link

SENAHK commented Jun 15, 2020

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

@arielfaur
Copy link
Owner

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 😆

@SENAHK
Copy link
Author

SENAHK commented Jun 24, 2020

Hey, no worries ! Thanks for your work, this ionic-pullup is very useful I must say !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants