-
Notifications
You must be signed in to change notification settings - Fork 419
Open
Labels
Milestone
Description
Description
lwc:dom="manual" restriction is not enforced when calling remove() api. https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove
This is inconsistent behavior because the restriction is enforced on removeChild() api.
Additionally, audit if there are other DOM manipulation APIs that the engine is not enforcing the restriction on.
Steps to Reproduce
<template>
<div>
<span></span>
</div>
<template>
export default class Foo extends LightningElement {
someMethod() {
const span = this.template.querySelector('span');
span.remove(); // Does not throw
span.parent.removeChild(span); // Will throw an exception because of restriction
}
}