diff --git a/frappe/public/js/frappe/form/controls/base_control.js b/frappe/public/js/frappe/form/controls/base_control.js index 9d9c919e97..9f3f53cad6 100644 --- a/frappe/public/js/frappe/form/controls/base_control.js +++ b/frappe/public/js/frappe/form/controls/base_control.js @@ -6,6 +6,18 @@ frappe.ui.form.Control = class BaseControl { // if developer_mode=1, show fieldname as tooltip if (frappe.boot.user && frappe.boot.developer_mode === 1 && this.$wrapper) { this.$wrapper.attr("title", __(this.df.fieldname)); + } else if (this.$wrapper) { + // show fieldname as tooltip when cmd/ctrl key is pressed + $(document).on("keydown", (e) => { + if (e.metaKey) { + this.$wrapper.attr("title", __(this.df.fieldname)); + } + }); + $(document).on("keyup", (e) => { + if (!e.metaKey) { + this.$wrapper.removeAttr("title"); + } + }); } if (this.render_input) {