Not sure if a feature or a bug, but I’ve noticed that I cannot get instance.triggerevent("something_has_happened")
to fire when my plugin’s page element is placed inside a repeating group as well as when triggerEvent()
is itself called from an event listener.
What I’m trying to do:
If the user clicks something inside the HTML of my plugin element, I want to trigger a bubble workflow to run.
run triggerEvent() from an event listener when plugin element is outside of repeating group = OK
run triggerEvent() without event listener inside repeating group using update() function = OK
run triggerEvent() with element inside a repeating group, triggered by event listener = BROKEN
I did verify that the event listener is indeed firing when my element is placed in a repeating group.
item.onclick = ( ) => { instance.triggerEvent('test') ;
alert();
};
In the above case, the alert() window did get triggered, however instance.triggerEvent('test')
did not not fire.
When I place the element outside of the repeating group triggerEvent()
and alert()
both fired.
Taking it a step further
item.onclick = ( ) => {
instance.triggerEvent('test') ;
console.log(instance.triggerEvent())
};
does show instance.triggerEvent()
is still defined with the exact same function code at the time of user interaction so it doesn’t seem to be any sort of esoteric platform-related behavior of the instance.triggerEvent()
object/function