mirror of
https://github.com/yjs/yjs.git
synced 2026-02-23 19:49:59 +01:00
proper cloning of yxmlElement with attributes that are not strings
This commit is contained in:
@@ -94,12 +94,10 @@ export class YXmlElement extends YXmlFragment {
|
||||
const el = new YXmlElement(this.nodeName)
|
||||
const attrs = this.getAttributes()
|
||||
object.forEach(attrs, (value, key) => {
|
||||
if (typeof value === 'string') {
|
||||
el.setAttribute(key, value)
|
||||
}
|
||||
el.setAttribute(key, /** @type {any} */ (value))
|
||||
})
|
||||
// @ts-ignore
|
||||
el.insert(0, this.toArray().map(item => item instanceof AbstractType ? item.clone() : item))
|
||||
el.insert(0, this.toArray().map(v => v instanceof AbstractType ? v.clone() : v))
|
||||
return el
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user