Skip to content

Commit

Permalink
fix(core): add fd-shellbar action button title and aria-label (#11031)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsnode authored Dec 1, 2023
1 parent fd8570c commit 664a780
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
fdType="transparent"
class="fd-shellbar__button"
fdCozy
[attr.title]="title"
[ariaLabel]="ariaLabel"
[glyph]="glyph"
(click)="callback ? callback($event) : ''"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core';
import { FD_SHELLBAR_ACTION_COMPONENT } from '../tokens';
import { Nullable } from '@fundamental-ngx/cdk/utils';

/**
* The component that represents a shellbar action.
Expand Down Expand Up @@ -45,4 +46,12 @@ export class ShellbarActionComponent {
/** Represents the number of notifications. */
@Input()
notificationCount: number;

/** title of the action button. */
@Input()
title: Nullable<string>;

/** aria-label of the action button */
@Input()
ariaLabel: Nullable<string>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
[label]="action.label"
[notificationCount]="action.notificationCount"
[notificationLabel]="action.notificationLabel"
[title]="action.title"
[ariaLabel]="!action.notificationCount ? action.ariaLabel : ''"
></fd-shellbar-action>

<fd-product-switch>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,17 @@ export class ShellbarCollapsibleExampleComponent {
glyph: 'pool',
callback: this.actionPoolCallback,
label: 'Pool',
notificationCount: 3,
title: 'Pool',
ariaLabel: 'Pool',
notificationCount: 0,
notificationLabel: 'Pool Count'
},
{
glyph: 'bell',
callback: this.actionNotificationCallback,
label: 'Notifications',
title: 'Notifications',
ariaLabel: 'Notifications',
notificationCount: 12,
notificationLabel: 'Unread Notifications'
}
Expand Down

0 comments on commit 664a780

Please sign in to comment.