#7185 closed defect (fixed)
Button: overwrites "title" attribute if "showLabel" is false
Reported by: | Malte Randt | Owned by: | Becky Gibson |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | Dijit - Form | Version: | 1.1.1 |
Keywords: | button label title tooltip | Cc: | [email protected]…, Becky Gibson |
Blocked By: | Blocking: |
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)
Change History (6)
comment:1 Changed 13 years ago by
Cc: | Becky Gibson added |
---|
comment:3 Changed 13 years ago by
Milestone: | tbd → 1.2 |
---|
comment:4 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [14510]) fixes #7185 If a title attribute has been provided on a button, do not set the label as the title when showLabel=false. This does not affect the screen reader since it does not speak the title it speaks the label. The label is provided to the screen reader via the ARIA labelledby property which points to the node with the label text.
comment:5 Changed 12 years ago by
Summary: | dijit.form.Button overwrites "title" attribute if "showLabel" is false → Button: overwrites "title" attribute if "showLabel" is false |
---|
Note: base ticket was #3815.
comment:6 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
I understand your issue.
I think we are doing that for a11y reasons, so that screen readers know what to speak (like to say "cut" for the picture of a pair of scissors). Seems related/the same as #3876. Becky, can you comment?