fix: Show nothing for empty value instead of undefined

(cherry picked from commit 7a84a3f3ea)
This commit is contained in:
Suraj Shetty 2021-04-29 17:42:57 +05:30 committed by mergify-bot
parent 4d782f9196
commit 601aeb5373

View file

@ -292,12 +292,12 @@ frappe.form.formatters = {
return formatted_values.join(', ');
},
Color: (value) => {
return `<div>
return value ? `<div>
<div class="selected-color" style="background-color: ${value}"></div>
<span class="color-value">${value}</span>
</div>`;
</div>` : '';
}
}
};
frappe.form.get_formatter = function(fieldtype) {
if(!fieldtype)