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(tooltip): Change Detection Error When Not in Production Mode #296

Closed
sqwk opened this issue Mar 18, 2016 · 6 comments
Closed

bug(tooltip): Change Detection Error When Not in Production Mode #296

sqwk opened this issue Mar 18, 2016 · 6 comments
Labels
Milestone

Comments

@sqwk
Copy link

sqwk commented Mar 18, 2016

When not in productionMode() the following error is logged to the console:

EXCEPTION: Expression '{top: top, left: left, display: display} in TooltipContainer@1:5' has changed after it was checked. Previous value: '-1000px'. Current value: '-19px' in [{top: top, left: left, display: display} in TooltipContainer@1:5]

Currently using 1.0.7

<button class="btn btn-secondary" tooltip="Some Tooltip">Miep</button>

import {Component} from 'angular2/core'
import {TOOLTIP_DIRECTIVES} from 'ng2-bootstrap/ng2-bootstrap';

@Component({
    …
    directives: [TOOLTIP_DIRECTIVES]
})
export class SomeComponent {
    …
}
@Toktik
Copy link

Toktik commented Mar 21, 2016

+1

Do you understand what's going on here? I still don't understand how ChangeDetection works, but I tried setting ChangeDetectionStrategy.OnPush on tooltip holder's component (as suggested by others in angular project page). No luck.

@valorkin valorkin added this to the beta.12 milestone Mar 24, 2016
@valorkin valorkin added the issue label Mar 24, 2016
@born2net
Copy link

+1 same issue in 0.12
quoted: "In development mode, tick() also performs a second change detection cycle to ensure that no further changes are detected. If additional changes are picked up during this second cycle, bindings in the app have side-effects that cannot be resolved in a single change detection pass. In this case, Angular throws an error, since an Angular application can only have one change detection pass during which all change detection must complete." and so I believe since a timer is used for the Alert, it is causing the side effect of the tooltip as its a change not coming from the component's binding.

@MonkeyDo
Copy link

MonkeyDo commented Apr 1, 2016

I am still getting the same issue with the latest version (1.0.10).
Using ChangeDetectorRef.detectChanges() rather than ChangeDetectorRef.markForCheck() in a timeout solved it for me.

MonkeyDo added a commit to MonkeyDo/ng2-bootstrap that referenced this issue Apr 1, 2016
I was still getting change detector error on tooltips after commit 413c2f1 .
This change solved it for me, and as a bonus no timeout hack needed.
@theunreal
Copy link

I have the same error when mouseovering my button..

@valorkin
Copy link
Member

angular2 version\ng2-bootstrap version\browser\system.js or webpack?

@ruwhan
Copy link

ruwhan commented Apr 24, 2016

got exactly same bug in the modal, I'm using ng2-bs3-modal. system.js.

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

No branches or pull requests

7 participants