Skip to content

Commit

Permalink
if tabindex has a value, use it for attribute otherwise don't set tab…
Browse files Browse the repository at this point in the history
…index
  • Loading branch information
bsatarnejad committed Oct 23, 2024
1 parent b43700e commit 2759626
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/octicons_angular/src/octicon-component-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ export class OpOcticonComponentBase {
@Input() size:SVGSize = 'medium';
@Input() verticalAlign = 'text-bottom';
@Input() title = '';
@Input() tabIndex?: number;

@HostBinding('attr.role') role = 'img';
@HostBinding('attr.fill') @Input() fill = 'currentColor';
@HostBinding('attr.id') @Input() id = '';
@HostBinding('attr.tabindex') @Input() tabIndex?:number;
@HostBinding('attr.aria-label') @Input('aria-label') ariaLabel = '';
@HostBinding('attr.aria-labelledby') @Input('aria-labelledby') arialabelledby = '';

@HostBinding('class.octicon') baseClassName = true;
@HostBinding('attr.aria-hidden') get ariaHidden() {
return !this.ariaLabel;
}
@HostBinding('attr.tabindex') get tabIndexAttr() {
return this.tabIndex != null ? this.tabIndex : null;
}
@HostBinding('attr.focusable') get focusable() {
return (this.tabIndex && this.tabIndex >= 0);
}
Expand Down

0 comments on commit 2759626

Please sign in to comment.