Ticket #7185 (closed defect: fixed)

Opened 5 months ago

Last modified 4 months ago

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)

Change History

Changed 5 months ago by bill

  • cc becky added

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?

Changed 5 months ago by doughays

  • owner set to becky

see also #3876

Changed 5 months ago by becky

  • milestone changed from tbd to 1.2

Changed 5 months ago by becky

  • status changed from new to closed
  • resolution set to fixed

(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.

Changed 4 months ago by bill

  • summary changed from dijit.form.Button overwrites "title" attribute if "showLabel" is false to Button: overwrites "title" attribute if "showLabel" is false

Note: base ticket was #3815.

Note: See TracTickets for help on using tickets.