creativetimofficial / ct-material-dashboard-pro-angular

68 stars 35 forks source link

[Bug] Login popup not loaded #415

Open w9wen opened 2 years ago

w9wen commented 2 years ago

Version

2.7.0

Reproduction link

https://demos.creative-tim.com/material-dashboard-pro-angular2/#/dashboard

Operating System

Windows 11 & macOS Ventura

Device

Notebook & Macbook

Browser & Version

Chrome & Edge

Steps to reproduce

Just using ng serve

What is expected?

The Login pupup correctly when the Login Page open.

What is actually happening?

The Login pupup not loaded when the Login Page open.


Solution

Additional comments

w9wen commented 2 years ago

Thanks'

algraps commented 1 year ago

Hi.

I have the same problem. Is it solved?

Alessandro

fhoog1844 commented 7 months ago

This is caused by the 'card' variable being initialized to soon. In login.component.ts, in ngOnInit(), change:

        const card = document.getElementsByClassName('card')[0];
        setTimeout(function() {
            // after 1000 ms we add the class animated to the login/register card
            card.classList.remove('card-hidden');
        }, 1000);

To:

        setTimeout(function() {
            // after 1000 ms we add the class animated to the login/register card
            const card = document.getElementsByClassName('card')[0];
            card.classList.remove('card-hidden');
        }, 1000);

The same holds for the 'lock' page.