Fixed issue where foreignObject contents styles were getting removed on object moving (#1053)

This commit is contained in:
Michael S. Scherotter
2025-05-04 23:55:18 -07:00
committed by GitHub
parent 4b822fe190
commit f962f9d884

View File

@@ -662,9 +662,18 @@ const mouseUpEvent = (evt) => {
const elem = selectedElements[0]
if (elem) {
elem.removeAttribute('style')
walkTree(elem, (el) => {
el.removeAttribute('style')
})
// we don't remove the style elements for contents of foreignObjects
// because that is a valid way to style them
if (elem.localName === 'foreignObject') {
walkTree(elem, (el) => {
el.style.removeProperty('pointer-events')
})
} else {
walkTree(elem, (el) => {
el.removeAttribute('style')
})
}
}
}
return