Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

GUI freezes until click event returns

$
0
0

@Oskarkarlsson wrote:

Hi!

I'm having som issues with a button in my Ionic app. My button have a click event "loginEvent()" that performs a login for the user. I have two span tags that is supposed to display a loading symbol while the login is performed.

The problem is that the button is not updated with the loading symbol until the loginEvent() returns. The click animation on the button does also not run until the loginEvent() returns.

Any idea why my button behaves like this?

Login button

<button ion-button block (click)="loginEvent();">
    <span *ngIf="!isLoading">Logga in</span>
    <span *ngIf="isLoading"><ion-spinner></ion-spinner></span>
</button>

loginEvent()

loginEvent() {
    console.log("login");
    this.isLoading = true;
    this.userHandler.login(this.username, this.password, this);
    console.log("/login")
  }

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>