You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Error: $digest already in progress exception using element.focus in directive #1250
To get this working, you have to use setTimeout / $timeout service, otherwise you are trying to focus hidden element (the select becomes visible after your .focus() call).
Plus .focus() triggers DOM event (synchronously) - so as long as you have some other directive listening on fired even (in this case ui-event listens on blur), it tries to do $apply() within $apply.
To get this working, you have to use setTimeout / $timeout service,
otherwise you are trying to focus hidden element (the select becomes
visible after your .focus() call).
Plus .focus() triggers DOM event (synchronously) - so as long as you have
some other directive listening on fired even (in this case ui-event listens
on blur), it tries to do $apply() within $apply.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/1250#issuecomment-8523479.
To get this working, you have to use setTimeout / $timeout service,
otherwise you are trying to focus hidden element (the select becomes
visible after your .focus() call).
Plus .focus() triggers DOM event (synchronously) - so as long as you have
some other directive listening on fired even (in this case ui-event listens
on blur), it tries to do $apply() within $apply.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/1250#issuecomment-8523479.
I've been having the same issue, where parent scopes weren't getting updated straight away using $watch until the next time $apply/$digest was called. So I had to resort to using the setTimeout method @johntowell used. I'll make a plunker here later today.
Activity
vojtajina commentedon Sep 13, 2012
Not sure that this is a bug in Angular.
To get this working, you have to use setTimeout / $timeout service, otherwise you are trying to focus hidden element (the select becomes visible after your .focus() call).
Plus .focus() triggers DOM event (synchronously) - so as long as you have some other directive listening on fired even (in this case ui-event listens on blur), it tries to do $apply() within $apply.
mhevery commentedon Sep 17, 2012
I actually think there should be a way to support this without resolving to
timeout.
On Thu, Sep 13, 2012 at 2:59 AM, Vojta Jina [email protected]:
mhevery commentedon Sep 17, 2012
perhaps something like asyncEval but asyncPostDigest
On Sun, Sep 16, 2012 at 9:13 PM, Misko Hevery [email protected] wrote:
cj commentedon Oct 17, 2012
I've been having the same issue, where parent scopes weren't getting updated straight away using $watch until the next time $apply/$digest was called. So I had to resort to using the
setTimeoutmethod @johntowell used. I'll make a plunker here later today.btford commentedon Dec 20, 2013
$timeoutis a pragmatic approach for Angular1.x. In the future, this will (hopefully) be solved with Object.observe.