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

i get this error "Uncaught TypeError: Cannot call method 'toLowerCase' of undefined medium.editor.js?da833dcf63a62ae704445479a4bbdc13fb4538d5:317" #44

Closed
crapthings opened this issue Oct 3, 2013 · 5 comments

Comments

@crapthings
Copy link

when i select text of first line, then click h1 or h2 button, this error show up at console

i use this with meteor.js and my code is like

Template.editDocument.rendered = ->
    editor = new MediumEditor '.editable'

<template name="editDocument">

    {{#with document}}
        <div id="main-head">
            <a href="{{pathFor 'viewDocument'}}" class="title">{{title}}</a>
        </div>

        <div id="main-body">
            <div class="content editable" data-placeholder="开始写文档。。。">{{content}}</div>
        </div>
    {{/with}}

</template>

this is part of error codes indicate around 317

 while (this.parentElements.indexOf(tagName) === -1) {
            selectionEl = selectionEl.parentNode;
            tagName = selectionEl.tagName.toLowerCase();
        }
@crapthings
Copy link
Author

i've tried times

only first line can't set h1 or h2 and the other buttons work.

@daviferreira
Copy link
Member

Heya, wich browser is that? Couldn't reproduce the problem.

@crapthings
Copy link
Author

chrome latest version

@daviferreira
Copy link
Member

Got it now, it happens when the contenteditable has only text, with no tags. Going to fix it soon, thanks.

@crapthings
Copy link
Author

oh my Ferreira ~~~ lalala awesome!

nysk pushed a commit to nysk/medium-editor that referenced this issue Aug 10, 2015
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