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

updateLoadingHtml isn't working #24

Closed
Meldinoor opened this issue May 16, 2016 · 3 comments
Closed

updateLoadingHtml isn't working #24

Meldinoor opened this issue May 16, 2016 · 3 comments

Comments

@Meldinoor
Copy link

When I call updateLoadingHtml, with or without the "immediate" flag set to true, my loading html disappears and is not replaced with a new one. I've discovered that it is due to the pg-removing class not being removed and the html thus having opacity: 0.
I debugged the code and found that the listener that captures the animation event, calls the method _changeLoadingHtml() which removes the pg-removing class, but then immediately puts it back again. This seems a little odd. Am I missing something, or is this a bug?

@matte00
Copy link

matte00 commented May 30, 2017

Is this project stopped? I confirm. UpdateLoadingHtml doesn't works

@ianhattendorf
Copy link

I've forked the project and disabled transition support, which is the reason the pg-removing class wasn't being removed (for some reason the transition event isn't being fired). Updating the loading HTML is now working for me, with the caveat that there aren't any nice transitions.

https://github.com/ianhattendorf/please-wait

@Toilal
Copy link

Toilal commented Oct 6, 2017

I workaround this issue by performing direct DOM manipulation of HTML I want to change from initial one.

  setLoadingMessage(message: string) {
    let element = document.querySelector('.pg-loading-html .loading-message');
    if (element) {
      element.innerHTML = message;
    }
  }

  setLoadingError(error: boolean) {
    let loadingElement = document.body;
    if (loadingElement) {
      if (error) {
        loadingElement.classList.add('pg-loading-error');
      } else {
        loadingElement.classList.remove('pg-loading-error');
      }
    }
  }

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

5 participants