fxmontigny / ng2-ace-editor

Ace editor integration with typescript for angular 4 - 5
MIT License
199 stars 92 forks source link

Prevent undo from clearing the initial editor content #75

Open dlang117 opened 6 years ago

dlang117 commented 6 years ago

I'm trying to use ng2-ace-editor with my Angular 5 application and I noticed that when I go to use the editor after the page and content has loaded, I'm immediately able to press Ctrl+Z which clears the content in the editor (by, I'm assuming, triggering an Undo event), even though there hasn't been any actual modification to the content.

Can this functionality be prevented somehow? Is there some combination of options and/or event callbacks that could stop the initial content load from being undone with Ctrl+Z?

I'm currently using ng2-ace-editor@0.3.4

Other info: Angular CLI: 1.6.5 Node: 8.10.0 OS: linux x64 Angular: 5.2.1 ... common, compiler, compiler-cli, core, forms, http ... language-service, platform-browser, platform-browser-dynamic ... router

@angular/animations: 5.2.4 @angular/cdk: 5.2.0 @angular/cli: 1.6.5 @angular/material: 5.2.0 @angular-devkit/build-optimizer: 0.0.41 @angular-devkit/core: 0.0.28 @angular-devkit/schematics: 0.0.51 @ngtools/json-schema: 1.1.0 @ngtools/webpack: 1.9.5 @schematics/angular: 0.1.16 typescript: 2.5.3 webpack: 3.10.0

dlang117 commented 6 years ago

I formatted my package list incorrectly in the initial issue description. Here it is again:

Angular CLI: 1.6.5
Node: 8.10.0
OS: linux x64
Angular: 5.2.1
... common, compiler, compiler-cli, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... router

@angular/animations: 5.2.4
@angular/cdk: 5.2.0
@angular/cli: 1.6.5
@angular/material: 5.2.0
@angular-devkit/build-optimizer: 0.0.41
@angular-devkit/core: 0.0.28
@angular-devkit/schematics: 0.0.51
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.5
@schematics/angular: 0.1.16
typescript: 2.5.3
webpack: 3.10.0