Closed bmblb closed 4 months ago
alternative solution could be to change listener target from shadow root to the container element which supports listener options
Forum post: https://forum.bryntum.com/viewtopic.php?p=146382
Seems to be fixed since 5.6.10
Hello!
On Salesforce Org, when the grid is displayed and you right click on the grid to display the edit widget. It throws an error that it cannot add event listeners. This error appears on the scheduler and gantt as well.
Grid Configuration
Investigation Results Based on the investigation results, it seems that when b-menu-1 element is trying to call addEventListener it throws an error saying that TheaddEventListenermethod on ShadowRoot does not support any options.. This error is thrown on the if condition statement calling addEventListener in the addElementListener function. It fails to add event listeners are doHideOrRealign and realignOnTransitionEnd.
One thing I noticed is that on function is called twice for each mentioned event, the first iteration for each event runs fine but, the second iteration throws an error. The second iteration is initiated in a setTimeout.
Hi all,
I was able to narrow this down to the EventHelper.addElementListener() method.
LWC does not support the options object in addEventListener(). Those options are constructed from the handlerSpec and defaults. The Salesforce specific override for addElementListener() removes certain properties from the handlerSpec: capture, once, and passive. But those values remain on the defaults object, so the EventHelper.createHandler() method restores them in the final spec object.
I hope this is making sense thus far.
The workaround I found is to remove unwanted properties from the defaults before passing them into the overridden addElementListener.