Skip to content

Commit 96996c7

Browse files
committed
fix(ngx-codejar): can't change code on firefox
1 parent 97e4e67 commit 96996c7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libs/ngx-codejar/src/lib/ngx-code-jar.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,13 @@ export class NgxCodeJarComponent implements AfterViewInit, OnChanges, OnDestroy
112112
private checkReadonly() {
113113
if (this.editor?.nativeElement) {
114114
if (this.readonly) {
115-
this.renderer.setAttribute(this.editor?.nativeElement, 'contenteditable', 'none');
115+
this.renderer.setAttribute(this.editor?.nativeElement, 'contenteditable', 'false');
116116
} else {
117-
this.renderer.setAttribute(this.editor?.nativeElement, 'contenteditable', 'plaintext-only');
117+
if(/Firefox/.test(navigator.userAgent)){
118+
this.renderer.setAttribute(this.editor?.nativeElement, 'contenteditable', 'true');
119+
} else {
120+
this.renderer.setAttribute(this.editor?.nativeElement, 'contenteditable', 'plaintext-only');
121+
}
118122
}
119123
}
120124
}

0 commit comments

Comments
 (0)