ng2-ace-editor icon indicating copy to clipboard operation
ng2-ace-editor copied to clipboard

Cursor/ Mouse pointer doesn't seem to update at correct location in the editor

Open saurabhchavan opened this issue 7 years ago • 4 comments

Issue: The edit happens at the incorrect location on the editor.

Package Version: Angular 6

ace-editor

 <ace-editor 
          id = "editor"
          #editor class="editor"
          [readOnly]="false"
          [mode]="'json'"
          [theme]="'monokai'"
          [autoUpdateContent]="false"
          (textChanged)="onChange($event)" 
          [options]="options"
          [(text)]="text"></ace-editor>
// editor
import 'brace';
import 'brace/theme/monokai';
import 'brace/mode/json';

  @ViewChild('editor') editor;
  @Input() text;

 options: any = {
    showPrintMargin: false,
    showInvisibles: true,
    highlightGutterLine: false,
    highlightActiveLine: false,
    fadeFoldWidgets: true,
    showLineNumbers: true,
    howGutter: true,
    fontSize: 16,
    wrap: false,
    mode: 'ace/mode/json'
};

  onChange(event) {
    this.text = event;
  }

saurabhchavan avatar Aug 24 '18 17:08 saurabhchavan

@saurabhchavan any Update on this. i am having the same issue. Do you have any workaround.??

itaimoorali avatar Dec 17 '18 07:12 itaimoorali

No I couldn’t get it to work. So I switch to using monaco editor.

saurabhchavan avatar Dec 18 '18 23:12 saurabhchavan

The solution is to add this CSS to your code. Because ng2-ace-editor only accept monospace font

.ace_line {
    span {
      font-family: monospace !important;
    }
  }

hunghoang94 avatar Sep 05 '19 05:09 hunghoang94

::ng-deep { .ace_line, .ace_line span { font-family: monospace !important; } }

javadoffuad avatar Dec 02 '19 08:12 javadoffuad