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

DOMException Thrown on .move() with HTML Content #386

Open
quadratz opened this issue Aug 6, 2024 · 0 comments
Open

DOMException Thrown on .move() with HTML Content #386

quadratz opened this issue Aug 6, 2024 · 0 comments

Comments

@quadratz
Copy link

quadratz commented Aug 6, 2024

The following code works perfectly fine:

new TypeIt(el)
  .type("Hello")
  .type("wrld!")
  .move(-4)
  .type("o")
  .go()

However, when wrapping the text in HTML tags, an error is thrown:

new TypeIt(el)
  .type("<span>Hello</span>")
  .type("<span>wrld!</span>")
  .move(-4)
  .type("o")
  .go()
Uncaught (in promise) DOMException: Node.insertBefore: Child to insert before is not a child of this node
    insertIntoElement index.es.js:391
    type_fn index.es.js:939
    func index.es.js:573
    execute index.es.js:289
    fireItem index.es.js:329
    beforePaint index.es.js:238
    beforePaint index.es.js:237
    beforePaint index.es.js:236
    fireItem index.es.js:328
    cb index.es.js:485
    setTimeout handler*wait/< index.es.js:488
    wait index.es.js:483
    wait_fn index.es.js:816
    fireItem index.es.js:324
    fireItemWithContext_fn index.es.js:798
    fire_fn index.es.js:737
    go index.es.js:537
    ....
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

1 participant