Skip to content

Commit

Permalink
fix(ngx-codejar): can't change code on firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpoemp committed Apr 9, 2024
1 parent 97e4e67 commit 96996c7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libs/ngx-codejar/src/lib/ngx-code-jar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,13 @@ export class NgxCodeJarComponent implements AfterViewInit, OnChanges, OnDestroy
private checkReadonly() {
if (this.editor?.nativeElement) {
if (this.readonly) {
this.renderer.setAttribute(this.editor?.nativeElement, 'contenteditable', 'none');
this.renderer.setAttribute(this.editor?.nativeElement, 'contenteditable', 'false');
} else {
this.renderer.setAttribute(this.editor?.nativeElement, 'contenteditable', 'plaintext-only');
if(/Firefox/.test(navigator.userAgent)){
this.renderer.setAttribute(this.editor?.nativeElement, 'contenteditable', 'true');
} else {
this.renderer.setAttribute(this.editor?.nativeElement, 'contenteditable', 'plaintext-only');
}
}
}
}
Expand Down

0 comments on commit 96996c7

Please sign in to comment.