UX: adds title attribute to widget dropdown header (#9597)

UX: adds title attribute to widget dropdown header (#9597)

diff --git a/app/assets/javascripts/discourse/app/widgets/widget-dropdown.js b/app/assets/javascripts/discourse/app/widgets/widget-dropdown.js
index 0b26f8d..dbb34a5 100644
--- a/app/assets/javascripts/discourse/app/widgets/widget-dropdown.js
+++ b/app/assets/javascripts/discourse/app/widgets/widget-dropdown.js
@@ -56,9 +56,11 @@ export const WidgetDropdownHeaderClass = {
   tagName: "button",
 
   transform(attrs) {
-    return {
-      label: attrs.translatedLabel ? attrs.translatedLabel : I18n.t(attrs.label)
-    };
+    return { label: this._buildLabel(attrs) };
+  },
+
+  buildAttributes(attrs) {
+    return { title: this._buildLabel(attrs) };
   },
 
   buildClasses(attrs) {
@@ -85,7 +87,11 @@ export const WidgetDropdownHeaderClass = {
     {{#if attrs.caret}}
       {{d-icon "caret-down"}}
     {{/if}}
-  `
+  `,
+
+  _buildLabel(attrs) {
+    return attrs.translatedLabel ? attrs.translatedLabel : I18n.t(attrs.label);
+  }
 };
 
 createWidget("widget-dropdown-header", WidgetDropdownHeaderClass);

GitHub sha: 0d84f3af

This commit appears in #9597 which was merged by jjaffeux.