Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cursorActivity event does not trigger angular change detection #101

Closed
urish opened this issue Jun 14, 2018 · 3 comments
Closed

cursorActivity event does not trigger angular change detection #101

urish opened this issue Jun 14, 2018 · 3 comments

Comments

@urish
Copy link

urish commented Jun 14, 2018

Here is an example that reproduces this issue:

https://stackblitz.com/edit/code-mirror-issue?file=src%2Fapp%2Fapp.component.html

You will notice that if you move the cursor while the editor has focus, the coordinates of the cursor won't update until you blur the editor. A workaround I found was to manually trigger change detection, so it seems like wrapping the event listener with NgZone.run() can fix this.

If you wish, I can work on a PR for this. Thanks for creating this project!

@scttcper
Copy link
Owner

Hi Uri, I think I was looking at why so many change detection cycles were being triggered and turned a few things off. I've turned change detection back on for cursorActivity and left it off for scroll activity and added a note to the readme for that.

@scttcper
Copy link
Owner

🎉 This issue has been resolved in version 1.3.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@urish
Copy link
Author

urish commented Jun 14, 2018

Great, thanks for the super-quick response & fix!

p.s. I am using ngx-codemirror for tsquery-playground, which visualizes the AST for given TypeScript code. Going to update it now with the new release :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants