Skip to content

Prepend and after are inconsistent #35

Description

@marcelerz

When having following code:

var morph = Metamorph('foo');

Which results in the following markup:

...
<script id="metamorph-0-start" type="text/x-placeholder"></script>
foo
<script id="metamorph-0-end" type="text/x-placeholder"></script>
...

When we call after() on the Metamorph instance:

morph.after("bar");

We get this:

...
<script id="metamorph-0-start" type="text/x-placeholder"></script>
foo
<script id="metamorph-0-end" type="text/x-placeholder"></script>
bar
...

The innerHTML is not changed as it is injected after the script-tag.

And when we call prepend() on the Metamorph instance:

morph.prepend("bar");

We get this:

...
<script id="metamorph-0-start" type="text/x-placeholder"></script>
bar
foo
<script id="metamorph-0-end" type="text/x-placeholder"></script>
...

However, the innerHTML is here not modified even though it changed the content between the script-tags, giving incorrect data when innerHTML is requested.

Should there also be a before() and append() function? (I don't mean appendTo() here.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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