Skip to content

Commit

Permalink
Make code highlight unfocusable
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Oct 3, 2023
1 parent 072b3b2 commit b31cd77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/showcase/layout/doc/code/app.code.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component, ElementRef, Input, NgModule, ViewChild } from '@angular/core
import { ButtonModule } from 'primeng/button';
import { TooltipModule } from 'primeng/tooltip';
import { Code, ExtFile, RouteFile } from 'src/app/showcase/domain/code';
import { useStackBlitz, useCodeSandbox } from '../codeeditor';
import { useCodeSandbox, useStackBlitz } from '../codeeditor';

@Component({
selector: 'app-code',
Expand Down Expand Up @@ -36,6 +36,7 @@ export class AppCodeComponent {
if (typeof window !== undefined && window['Prism'] && this.codeElement && !this.codeElement.nativeElement.classList.contains('prism')) {
window['Prism'].highlightElement(this.codeElement.nativeElement);
this.codeElement.nativeElement.classList.add('prism');
this.codeElement.nativeElement.parentElement.setAttribute('tabindex', '-1');
}
}

Expand Down

1 comment on commit b31cd77

@vercel
Copy link

@vercel vercel bot commented on b31cd77 Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.