Skip to content

Commit 6330485

Browse files
authored
Merge pull request #3589 from jmk89/button-tooltip
Button tooltip fix - default to description
2 parents 3ce6472 + 5b4d5fb commit 6330485

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/controls/src/widget_button.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,13 @@ 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+
this.el.setAttribute('title', tooltip ?? description);
110+
108111
if (description.length || icon.length) {
109112
this.el.textContent = '';
110113
if (icon.length) {

0 commit comments

Comments
 (0)