[fix] timepicker in modal blurs on scroll fixes frappe/erpnext#8002
This commit is contained in:
parent
95bdf78585
commit
a5e7b3483b
3 changed files with 17 additions and 0 deletions
|
|
@ -52,6 +52,10 @@ frappe.Application = Class.extend({
|
|||
|
||||
$(document).trigger('app_ready');
|
||||
|
||||
frappe.ready_events.forEach(function(fn) {
|
||||
fn();
|
||||
});
|
||||
|
||||
if (frappe.boot.messages) {
|
||||
frappe.msgprint(frappe.boot.messages);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,3 +26,9 @@ frappe.provide("frappe.utils");
|
|||
frappe.provide("frappe.ui");
|
||||
frappe.provide("frappe.modules");
|
||||
frappe.provide("frappe.templates");
|
||||
|
||||
frappe.ready_events = [];
|
||||
frappe.ready = function(fn) {
|
||||
frappe.ready_events.push(fn);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,13 @@ frappe.ui.Dialog = frappe.ui.FieldGroup.extend({
|
|||
frappe.ui.open_dialogs.push(me);
|
||||
me.focus_on_first_input();
|
||||
me.on_page_show && me.on_page_show();
|
||||
})
|
||||
.on('scroll', function() {
|
||||
var $input = $('input:focus');
|
||||
if($input.length && ['Date', 'Datetime',
|
||||
'Time'].includes($input.attr('data-fieldtype'))) {
|
||||
$input.blur();
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue