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

Potential timing issue when quickly saving changes. #30

Closed
JoshMcCullough opened this issue Nov 21, 2016 · 1 comment
Closed

Potential timing issue when quickly saving changes. #30

JoshMcCullough opened this issue Nov 21, 2016 · 1 comment

Comments

@JoshMcCullough
Copy link
Contributor

(Note that I also commented on an issue in the main repo (froala/wysiwyg-editor#31 (comment)) but I believe this is a separate issue.)

Since it appears that the contentChanged event is only fired at most once per 200ms, there are timing issues if a user is quickly typing and then trying to save changes. We cannot rely on this event to have updated our underlying models because more text could have been added or removed within the last 200ms. So, we have instead decided to listen for the blur event and update our model when that changes.

We wrote our own Froala wrapper for Aurelia before the official one was released, and I did not test this with the official wrapper, but looking at the code, I see that the same issue is likely since value is only updated on contentChanged. I suggest you also update it on blur.

JoshMcCullough added a commit to JoshMcCullough/aurelia-froala-editor that referenced this issue Nov 21, 2016
@stefanneculai
Copy link
Contributor

If you want to get immediate model change, you could use the keyup event (see Angular version: https://github.com/froala/angular-froala/blob/master/src/angular-froala.js#L135). However, it might result in slow performance. Thanks for the blur suggestion.

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