swiftwasm / WebAPIKit

Access the DOM and other Web APIs from Swift! (Very much a WIP)
MIT License
61 stars 8 forks source link

ShadowRoot append child incorrect #50

Closed bestwnh closed 4 months ago

bestwnh commented 9 months ago

Now if I do this

let shadowRoot = rootView.attachShadow(init: .init(mode: .open, delegatesFocus: true, slotAssignment: .manual))
shadowRoot.ownerDocument?.body?.appendChild(node: childNode)

The shadow root is open correct, but the childNode wound't add to it. But if I change the second line to

shadowRoot.jsValue.appendChild(node.jsValue)

It would work.