boostrap-datetimepicker连续单击日历控件,日历不显示,需要点击控件外部,再次点击日历控件才显示日历选择器

18-01-31 11:10 字数 499 阅读 4064 已编辑

boostrap-datetimepicker连续单击日历控件,日历不显示,需要点击控件外部,再次点击日历控件才显示日历选择器

914e9ffef95939ee08dc19cc4664fc92.png
这个问题被测试提为bug
解决:
进入bootstrap-datetimepicker.js内部
约230行,首先将:$(document).on('mousedown', this.clickedOutside);
替换为:$(element).on('mousedown', this.clickedOutside);
其次注释(约111行)

/*    
 if ($(e.target).closest('.datetimepicker').length === 0) {    
            that.hide();    
}    
*/    

改成如下:

   this.clickedOutside = function (e) {    
        // Clicked outside the datetimepicker, hide it    
/*        if ($(e.target).closest('.datetimepicker').length === 0) {    
            that.hide();    
        }*/    
        if(that.isVisible)    
        {    
            that.hide();    
        }    
        else    
        {    
            that.show();    
        }    
    }  
1人点赞>
关注 收藏 改进 举报
1 条评论
排序方式 时间 投票
Up骚年

多谢老铁分享。

请登录后发表评论