Webstaff focusMe directive suffers from indigestion

Bug #1670512 reported by Bill Erickson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Undecided
Unassigned

Bug Description

Evergreen 2.12

The "focusMe", "blurMe", and "selectMe" directives manually call scope.$apply to keep model values in sync with the state of the DOM. If these scope.$apply() calls happen while an Angular digest is already running, it results in lots of nasty repeating console errors:

angular.js:14199 Error: [$rootScope:inprog] http://errors.angularjs.org/1.5.11/$rootScope/inprog?p0=%24digest
    at angular.js:38
    at n (angular.js:18357)
    at m.$apply (angular.js:18092)
    at HTMLInputElement.<anonymous> (ui.js:22)
    at HTMLInputElement.dispatch (jquery.min.js:3)
    at HTMLInputElement.r.handle (jquery.min.js:3)
    at ui-bootstrap-tpls.min.js:8
    at angular.js:16696
    at m.$eval (angular.js:17994)
    at m.$digest (angular.js:17808)

To reproduce (for focusMe):

1. Open the JS console
2. Perform a patron search. I typically get 3 of these per search.

Running the scope.$apply() calls inside a $timeout, which gives the in-progress digest time to complete, prevents the errors from occurring. Branch en route.

Revision history for this message
Bill Erickson (berick) wrote :

Fix pushed:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1670512-focus-me-etc-digest-errors

To confirm, following the steps to reproduce (above), the console errors will no longer appear with the branch installed. And continuing the patron search example, the focus behavior still behaves as expected (default to last name focus, changing focus is possible / un-buggy).

tags: added: pullrequest
Changed in evergreen:
milestone: none → 2.12-rc
assignee: Bill Erickson (berick) → nobody
Galen Charlton (gmc)
Changed in evergreen:
milestone: 2.12-rc → 2.12.0
Kathy Lussier (klussier)
Changed in evergreen:
status: New → Confirmed
assignee: nobody → Kathy Lussier (klussier)
Revision history for this message
Kathy Lussier (klussier) wrote :

Works for me. Thanks Bill!

Changed in evergreen:
assignee: Kathy Lussier (klussier) → nobody
status: Confirmed → Fix Committed
Galen Charlton (gmc)
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.