Skip to content

Commit dc81b05

Browse files
committed
Defaults the tooltip to the description, if tooltip not specified
1 parent 6f93578 commit dc81b05

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/controls/src/widget_button.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,15 @@ export class ButtonView extends DOMWidgetView {
101101
update(): void {
102102
this.el.disabled = this.model.get('disabled');
103103
this.updateTabindex();
104-
this.el.setAttribute('title', this.model.get('tooltip'));
105104

105+
const tooltip = this.model.get('tooltip');
106106
const description = this.model.get('description');
107107
const icon = this.model.get('icon');
108+
109+
tooltip
110+
? this.el.setAttribute('title', tooltip)
111+
: this.el.setAttribute('title', description);
112+
108113
if (description.length || icon.length) {
109114
this.el.textContent = '';
110115
if (icon.length) {

0 commit comments

Comments
 (0)