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

BUG: Multiple tickers per page - adjusting duration on one impacts the other #2

Closed
henry74 opened this issue Jun 17, 2019 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@henry74
Copy link

henry74 commented Jun 17, 2019

I'm using ng-marquee in an component. When I instantiate 2 version of the same component within a page, the duration input parameter changes the speed of the first component instead of the one it's being passed to.

@henry74
Copy link
Author

henry74 commented Jun 18, 2019

Looks like the issue is in the ngInit() - the querySelectorAll is pulling the first instance of the tag and adjusting the duration so if you have multiple instances, the first instance is always changed, no matter what:

    updateDuration() {
        if (!this.duration) {
            return;
        }
        this.animationElem.style.animationDuration = `${this.duration}s`;
    }
    /**
     * @return {?}
     */
    ngOnInit() {
        this.animationElem = /** @type {?} */ (document.querySelectorAll('.ng-marquee-wrapper > div')[0]);
        this.updateDuration();
    }

@shivarajnaidu
Copy link
Owner

shivarajnaidu commented Nov 26, 2019

Sorry for the delayed response .. I was busy with some stuff at my work .. Could you please make a pull request to backport the improvements to upstream ?

Thanks in advance @henry74

@shivarajnaidu shivarajnaidu added the bug Something isn't working label Nov 26, 2019
@shivarajnaidu shivarajnaidu self-assigned this Nov 26, 2019
@shivarajnaidu
Copy link
Owner

@henry74 this issue is now fixed 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants