From e63222cc9ac38855039df553f9024e1028f5b9e2 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 12 Aug 2021 16:33:09 +0530 Subject: [PATCH] fix: grid frozen issue --- frappe/public/js/frappe/form/grid.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/grid.js b/frappe/public/js/frappe/form/grid.js index cad32954e9..cda052553f 100644 --- a/frappe/public/js/frappe/form/grid.js +++ b/frappe/public/js/frappe/form/grid.js @@ -37,6 +37,8 @@ export default class Grid { } this.is_grid = true; + this.debounced_refresh = this.refresh.bind(this); + this.debounced_refresh = frappe.utils.debounce(this.debounced_refresh, 500); } allow_on_grid_editing() { @@ -675,6 +677,7 @@ export default class Grid { if (!idx) { idx = this.grid_rows.length - 1; } + setTimeout(() => { this.grid_rows[idx].row .find('input[type="Text"],textarea,select').filter(':visible:first').focus(); @@ -934,6 +937,6 @@ export default class Grid { // update the parent too (for new rows) this.docfields.find(d => d.fieldname === fieldname)[property] = value; - this.refresh(); + this.debounced_refresh(); } }