Skip to content

vanX reactive crash TypeError: keyToChild[k]?.remove is not a function with DocumentFragment #431

Description

@ttyridal

Example fidle: https://jsfiddle.net/nudhLf6x/3/

a vanX.list items are dictionary (Object) itemFunc is returning DocumentFragment

calling vanX.replace to update the items of the list. Adding is fine, changing value is fine, but it fails when a key from the items object is removed.

Fails the same way if (vanX.list) items is an array and trying to vanX.replace with fewer items than current state.

main.js:21 triggered
van-x.nomodule.js:75 Uncaught (in promise) TypeError: keyToChild[k]?.remove is not a function
    at onDelete (van-x.nomodule.js:75:22)
    at Object.deleteProperty (van-x.nomodule.js:49:35)
    at replaceInternal (van-x.nomodule.js:97:61)
    at Object.replace (van-x.nomodule.js:118:14)
    at fetchstuff (main.js:22:10)

If I remove the DocumentFragment (ie letting GridRow return a div instead) it works fine, but my grid doesn't (no parent node in a css grid row)

Love VanJS by the way :)

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