Adding an event listener on the custom element with a third options argument logs an error.
This restriction should be on the component instance and not on the host element. From the outside world, a DOM element should behave per spec when addEventListener is invoked with the options param, regardless of whether the element is a standard html element or a native custom element or an LWC host element.
https://playground.lwcjs.org/projects/d1fzv_d_h/3/edit
import { LightningElement, track } from 'lwc';
export default class App extends LightningElement {
renderedCallback() {
this.addEventListener('foo', () => {}, { passive: true });
}
}
Reference: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
FYI, this is probably just moving the following block:
to
This issue has been linked to a new work item: W-7446526
I'd have to dig in a little more but giving users the ability to subscribe to the capture phase of focusin might require us to refactor our delegatesFocus implementation. It might be fine as long as we always run first, not sure...
Looks like we only restrict this for the host element:
https://playground.lwcjs.org/projects/LY4Z_tvOv/1/edit