-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Description
I am trying to use RPGUI for a React project, however I am running into an issue where event handlers are not being passed to input fields. On closer inspection it seems the issue lies with the below function:
// copy all event listeners from one element to the other
RPGUI.copy_event_listeners = function(from, to)
{
// copy all event listeners
if (typeof getEventListeners == "function")
{
var events = getEventListeners(from);
for(var p in events) {
events[p].forEach(function(ev) {
// {listener: Function, useCapture: Boolean}
to.addEventListener(p, ev.listener, ev.useCapture);
});
}
}
// now copy all attributes that start with "on"
for (attr in from)
{
if (attr.indexOf("on") === 0)
{
to[attr] = from[attr];
}
}
};
This appears to be because the getEventListeners function is only defined in the console for devtools and is otherwise not available.
Thanks,
Metadata
Metadata
Assignees
Labels
No labels