openMF / community-app

This was the former default web application built on top of the Apache Fineract platform. It's now deprecated and replaced by the the Mifos X Web App (https://github.com/openMF/web-app maintained by the Mifos Initiative as a reference solution for financial inclusion. It is a Single-Page App (SPA) written in web standard technologies.
http://openmf.github.io/community-app/
Mozilla Public License 2.0
312 stars 1.02k forks source link

TypeError: element.focus is not a function in scripts/modules/datepicker.js:545 #1393

Open techkey opened 9 years ago

techkey commented 9 years ago

On line 545 of scripts/modules/datepicker.js a TypeError is thrown:

scope.$watch('isOpen', function (value) {
    if (value) {
        updatePosition();
        $document.bind('keydown', documentKeyBind);
        $document.bind('click', documentClickBind);
        element.unbind('focus', elementFocusBind);
        element.focus();              // <- line 545, TypeError: element.focus is not a function 
    } else {
        $document.unbind('click', documentClickBind);
        element.bind('focus', elementFocusBind);
    }

    if (setIsOpen) {
        setIsOpen(originalScope, value);
    }
});

because element is a JQLite array.

Another point of interest is at line 548, there's is an attempt to bind an event to the JQLite array.

mdew192837 commented 7 years ago

@techkey Is this still a problem? I can maybe fix for GCI. :)