instance-oom / ngx-markdown-editor

Angular markdown editor based on ace editor
http://lon-yang.github.io/markdown-editor/
Apache License 2.0
174 stars 48 forks source link

Use in combination with Reactive Forms #64

Closed Cyberuben closed 4 years ago

Cyberuben commented 4 years ago

I'm wondering if it's possible to use this library in combination with Reactive Forms, specifically being able to set / get the value using formControlName instead of ngModel?

If so, how do I achieve this?

EDIT

It seems it is possible, however, I do not seem to get any changes made, so it remains untouched when changing the content. Is this a bug?

instance-oom commented 4 years ago

I don't think so. If you using setValue to change the value with no user typing. It will not change the untouched status. You can try using input control to testing it.

Cyberuben commented 4 years ago

The issue is that when actually typing in the markdown editor, so without setValue, it still does not register the input as touched.

On Apr 27, 2020, 02:28, at 02:28, Lon notifications@github.com wrote:

I don't think so. If you using setValue to change the value with no user typing. It will not change the untouched status. You can try using input control to testing it.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/lon-yang/ngx-markdown-editor/issues/64#issuecomment-619649590

instance-oom commented 4 years ago

Got it. I will check this issue.

instance-oom commented 4 years ago

Please using 3.2.0

Cyberuben commented 4 years ago

I'm afraid this has introduced another bug. If I place my cursor anywhere in the editor and start typing, it automatically moves my cursor to the end of the input, then continues typing there.

Video of the issue

instance-oom commented 4 years ago

Sorry about that. it's already fixed in 3.2.1