-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Infinite loop #751
Comments
Hi! Thanks for the report. I tried to understand what happens, but it seems I don't. There's the Also, could you explain what do you do exactly? Even when fixing such low-level issues. we'd like to have a higher-level scenario to make sure that such a problem will never occur again. |
Hi Reinmar, If for some reason you have initiated an inline editor and then you try to reinitiate it, it will end in an infinite loop. <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="https://cdn.ckeditor.com/ckeditor5/1.0.0-alpha.2/inline/ckeditor.js"></script>
<script type="text/javascript">
function initEditor(sel) {
try {
var elm = document.querySelector(sel);
InlineEditor
.create(elm)
.then(editor => {
console.log(editor);
})
.catch(error => {
console.error(error);
});
} catch (err) {
console.error(err.message);
}
}
</script>
</head>
<body>
<div id="mfield-test" contenteditable="true" style="border: 1px solid gray; margin-bottom: 200px;">
<p>This is a test text</p>
</div>
<div onclick="initEditor('#mfield-test');;" style="border: 1px solid red; width: 200px;">init editor again</span>
<script type="text/javascript">
initEditor('#mfield-test');
</script>
</body>
</html> to reproduce it, run the example and then click on 'init editor again' |
Yep, it's a known problem. You can't initialise two editors on one element because they start to override each others' changes in that element. DUP of #746. |
💻 CKEditor 5 1.0.0-alpha.2 inline CDN
📋 Steps to reproduce
domNode is undefined and ancestors.length too but it will never be false.
✅ Exit the loop
❎ Doesn't quit
The text was updated successfully, but these errors were encountered: