From 2759626775317c26ba014aba36ad9a4387ca92ee Mon Sep 17 00:00:00 2001 From: Behrokh Satarnejad Date: Wed, 23 Oct 2024 15:39:13 +0200 Subject: [PATCH] if tabindex has a value, use it for attribute otherwise don't set tabindex --- lib/octicons_angular/src/octicon-component-base.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/octicons_angular/src/octicon-component-base.ts b/lib/octicons_angular/src/octicon-component-base.ts index b51e15635..e4f115de3 100644 --- a/lib/octicons_angular/src/octicon-component-base.ts +++ b/lib/octicons_angular/src/octicon-component-base.ts @@ -11,11 +11,11 @@ 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 = ''; @@ -23,6 +23,9 @@ export class OpOcticonComponentBase { @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); }