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

Froala V3 - TypeError: self._editor is null #87

Open
imuller opened this issue May 27, 2019 · 7 comments · May be fixed by #98
Open

Froala V3 - TypeError: self._editor is null #87

imuller opened this issue May 27, 2019 · 7 comments · May be fixed by #98

Comments

@imuller
Copy link

imuller commented May 27, 2019

When initializing a second editor after one is has dissapeared. For example when i create an editor and the container has v-if on it, the console shows an error and wont update the data object in Vue anymore.

TypeError: self._editor is null

Error occures on this line:
self._editor.html.set(self.model || ''); //This will reset the undo stack everytime the model changes externally. Can we fix this?

@nikpok
Copy link
Contributor

nikpok commented May 28, 2019

can you share an example code on JSfiddle @imuller ?

@pochocho
Copy link

pochocho commented Jun 6, 2019

@nikpok Im experiencing the same issue

here is a link where you can replicate the issue:
on that link open the browser console and click on the checkbox to toggle the visibility of the froala editor, when you click the checkbox again, you will get the error on the console.
Here is an image of the error in the console:
image

Some things I noticed, the problem seems to disappear if the config prop is specified with a plain json object on the tag directly. If you use a config from the data of the component is where it breaks.

You can also test this on the code I provided by commenting the first froala instance (line 8) and uncommenting the one bellow (line 11).

I did some digging on the source code and the issue seems to have something to do with the listener for the initialized event where in some instances, the _editor is not defined by the time it occurs.

@pochocho
Copy link

@nikpok just noticed the link was missing, here it is again https://codesandbox.io/s/vue-template-m7ssk

@imuller
Copy link
Author

imuller commented Jun 14, 2019

It's when i show the froala editor with an v-if

@gabaum10
Copy link

Can we get this merged in? This is a slightly annoying error.

@playerrtwo
Copy link

I'm also experiencing this problem. Need a fix please.

@rcheung9
Copy link

rcheung9 commented Feb 7, 2020

Still broken.

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

Successfully merging a pull request may close this issue.

7 participants