Skip to content

IE 10 Error: Invalid Argument on insertBefore #353

@caneruguz

Description

@caneruguz

I had this "Invalid Argument" error on otherwise working code:

screen shot 2014-11-22 at 2 22 27 pm

After some digging it looks like IE needs a valid DOM argument for the second argument of insertBefore. I'm not sure if in Mithril this always has to be a valid argument and I'm somehow making a mistake in my code. However changing the line from this:

parentElement.insertBefore(dummy, parentElement.childNodes[change.index])

to this, solved the problem:

parentElement.insertBefore(dummy, parentElement.childNodes[change.index] || null)

I'm using Mithril 0.1.22

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions