fix: Check if there is any active element

This commit is contained in:
Deepesh Garg 2021-08-03 13:49:01 +05:30
parent da50263c1e
commit 3fb9a27875

View file

@ -251,10 +251,12 @@ frappe.ui.form.Layout = class Layout {
this.refresh_section_collapse();
}
document.activeElement.focus();
if (document.activeElement.tagName == 'INPUT') {
document.activeElement.select();
if (document.activeElement) {
document.activeElement.focus();
if (document.activeElement.tagName == 'INPUT') {
document.activeElement.select();
}
}
}