Ticket #7185 (closed defect: fixed)
Button: overwrites "title" attribute if "showLabel" is false
| Reported by: | mrandt | Owned by: | becky |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.2 |
| Component: | Dijit | Version: | 1.1.1 |
| Severity: | normal | Keywords: | button label title tooltip |
| Cc: | mrandt@…, becky |
Description
Button overwrites the attribute "title" if "showLabel" is set to false. I suppose this is a defect in method "postCreate".
Example (tested on FF3.0 and IE7.0):
var button = new dijit.form.Button(
{
title: "myTitle",
iconClass: "myIconClass",
label: "myLabel",
showLabel: false
}
);
This will create a button showing the title "myLabel" rather than "myTitle".
Background: I'd like to create a button (placed on a toolbar) which has both an icon and a label. Depending on the user's preferences, I will disable or enable showLabel.
I will also have a tooltip connected to the button, therefore I want the title tag to be empty - otherwise the browser would display the title alongside the Dojo tooltip.
Possible solution:
1.) Only overwrite title in method postCreate if title is undefined (fix defect) 2.) Enhance dijit.form.Button by "showTitle" property and interpret this accordingly (enhancement)