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

JavaScript error when clicking on a button in non editable area if the editor does not have the focus #325

Closed
dpobel opened this issue Aug 20, 2015 · 0 comments
Labels
Milestone

Comments

@dpobel
Copy link
Contributor

dpobel commented Aug 20, 2015

For instance use the following code:

<div id="editable" contenteditable="true">
    <p>Lorem ipsum dolor es</p>
    <p contenteditable="false"><button>Click on me</button> before anything else</p>
</div>

<script>
    var editor = AlloyEditor.editable('editable');
</script>

and click on the button to get the error. But if you click first on the editable text and then use the button, everything is fine.

In Chrome, you get:

Uncaught TypeError: Cannot read property 'startNode' of undefined
getCaretRegion @ alloy-editor-all-min.js:1271
getClientRectsRegion @ alloy-editor-all-min.js:1420
getSelectionRegion @ alloy-editor-all-min.js:1328
getSelectionData @ alloy-editor-all-min.js:1310
(anonymous function) @ alloy-editor-all-min.js:1977
(anonymous function) @ alloy-editor-all-min.js:994
setTimeout (async)callFn @ alloy-editor-all-min.js:993
j @ alloy-editor-all-min.js:12
CKEDITOR.event.CKEDITOR.event.fire @ alloy-editor-all-min.js:14
CKEDITOR.dom.domObject.a @ alloy-editor-all-min.js:49

In Firefox :

TypeError: bookmarks[0] is undefined
@ipeychev ipeychev added the bug label Aug 21, 2015
@ipeychev ipeychev added this to the 0.5.0 milestone Aug 21, 2015
ipeychev added a commit that referenced this issue Aug 21, 2015
ipeychev added a commit that referenced this issue Jun 12, 2016
ipeychev added a commit that referenced this issue Jun 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants