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

Synchronize the editor content after the editor is ready #22

Merged
merged 2 commits into from
May 18, 2022
Merged

Conversation

psmyrek
Copy link
Contributor

@psmyrek psmyrek commented May 16, 2022

Suggested merge commit message (convention)

Fix: Synchronize the editor content after the editor is ready. Closes #21.


Additional information

For example – encountered issues, assumptions you had to make, other affected tickets, etc.

@psmyrek
Copy link
Contributor Author

psmyrek commented May 17, 2022

The easiest way to reproduce this error is by delaying the editor initialization:

  1. Go to master branch.
  2. In the mounted() hook, add a timeout before setting up the internal component data:
    this.editor.create( this.$el, editorConfig )
    +   .then( editor => new Promise( resolve => setTimeout( () => resolve( editor ), 5000 ) ) )
        .then( editor => {
  3. Build the editor: npm run build.
  4. Open the test sample. If you change the model value in the textarea (below the component) within 5 seconds, warnings and error will be logged in the console.
  5. Then check if the same scenario does not throw any errors and warnings on the i/21 branch. Remember to re-build the editor. The model value in textarea and in the editor content should stay in sync.

Copy link
Member

@pomek pomek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@pomek pomek merged commit 9c56952 into master May 18, 2022
@pomek pomek deleted the i/21 branch May 18, 2022 08:00
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

Successfully merging this pull request may close these issues.

this.$_instance is undefined error
2 participants