Calendar undefined instance



We catched multiple errors for code snippet below from diff users. Lib version used 3.2.0.

                theme: 'ios',
                lang: lang,
                display: 'bottom',
                dateFormat: '',
                min: min,
                max: max,
                onBeforeShow: function(event, inst) {
                onDayChange: function(event, inst) {
                    inst.setVal(, true)
                onBeforeClose: function (event, inst) {
                    if (!inst.**getVal()** && event.button == 'set') {
                        return false;
                defaultValue: defaultValue,

Logged error: StackTrace: TypeError: null is not an object (evaluating ‘inst.getVal’); Plattform: iOS; Device: iPhone10,4; OS version: 11.4.1;

P.S checked lib change log(3.2.X and 4.X) an didn’t found relevant fixes


Hi Vitalij,

I checked the above code, and created a test case, but the error did not occur for me. I tested with v3.2.0 and latest version as well. Could you describe the exact steps to reproduce the error?




that was catched by 7 unique iOS users(>100 times), mostly iPnone with 11.3.1 - 11.4.1 OS versions. Exact steps to reproduce i don’t have.

My best guess will be: When calendar instance is destroyed or in process of that ($(this).mobiscroll('destroy');), onBeforeClose is triggered lastly with already destroyed instance.