Fix link accessibilty issues (#16419)

* Fix link accessibilty issues

* Move comment
This commit is contained in:
Charles Gagnon
2021-07-26 14:55:33 -07:00
committed by GitHub
parent a0f56890b5
commit 6a08af4d9a
2 changed files with 7 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ import { ILogService } from 'vs/platform/log/common/log';
@Component({ @Component({
selector: 'modelview-hyperlink', selector: 'modelview-hyperlink',
template: `<a [href]="url" [title]="title" [attr.aria-label]="ariaLabel" [attr.role]="ariaRole" target="blank" [ngStyle]="CSSStyles" [class]="cssClass">{{label}}</a>` template: `<a [href]="url" [title]="getDisplayedTitle()" [attr.aria-label]="ariaLabel" [attr.role]="ariaRole" target="blank" [ngStyle]="CSSStyles" [class]="cssClass">{{label}}</a>`
}) })
export default class HyperlinkComponent extends TitledComponent<azdata.HyperlinkComponentProperties> implements IComponent, OnDestroy, AfterViewInit { export default class HyperlinkComponent extends TitledComponent<azdata.HyperlinkComponentProperties> implements IComponent, OnDestroy, AfterViewInit {
@Input() descriptor: IComponentDescriptor; @Input() descriptor: IComponentDescriptor;
@@ -73,6 +73,10 @@ export default class HyperlinkComponent extends TitledComponent<azdata.Hyperlink
return this.getPropertyOrDefault<boolean>((props) => props.showLinkIcon, false); return this.getPropertyOrDefault<boolean>((props) => props.showLinkIcon, false);
} }
public getDisplayedTitle(): string {
return this.title || this.url || '';
}
public onClick(e: MouseEvent): void { public onClick(e: MouseEvent): void {
this.fireEvent({ this.fireEvent({
eventType: ComponentEventType.onDidClick, eventType: ComponentEventType.onDidClick,

View File

@@ -76,9 +76,11 @@ body.web {
cursor: pointer; cursor: pointer;
} }
/* {{SQL CARBON EDIT}} Underline links
.monaco-workbench a { .monaco-workbench a {
text-decoration: none; text-decoration: none;
} }
*/
.monaco-workbench a:active { .monaco-workbench a:active {
color: inherit; color: inherit;