Skip to content

referenceNode argument to Node.insertBefore should be nullable #62

Open
@zopsicle

Description

@zopsicle

https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore reads:

referenceNode The node before which newNode is inserted. If this is null, then newNode is inserted at the end of node's child nodes.

but Node.insertBefore requires a reference node to be provided.

Possible workaround:

case referenceNode of
  Just r -> Node.insertBefore newNode r this
  Nothing -> Node.appendChild newNode this

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