Skip to content

aria-label on close button in Panel not set #1641

Description

@slumley1

Bug Report

Priorities and help requested (not applicable if asking question):

Are you willing to submit a PR to fix? Yes

Requested priority: Normal

Products/sites affected:

Describe the issue:

The Panel component has a property closeButtonAriaLabel. This property is not being correctly set for the close button. The Panel creates the close button with following code:

<IconButton
        className={ css('ms-Panel-closeButton ms-PanelAction-close', styles.closeButton) }
        onClick={ this._onPanelClick }
        aria-label={ closeButtonAriaLabel }
        data-is-visible={ true }
        iconProps={ { iconName: 'Cancel' } }
      />

The problem is that the IconButton has a property ariaLabel which needs to be set. I think this code should be changed to:

<IconButton
        className={ css('ms-Panel-closeButton ms-PanelAction-close', styles.closeButton) }
        onClick={ this._onPanelClick }
        ariaLabel={ closeButtonAriaLabel }
        data-is-visible={ true }
        iconProps={ { iconName: 'Cancel' } }
      />

Actual behavior:

The aria-label is not set.

Expected behavior:

The label gets set as passed in.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions