Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gui: on the frontend, the control callback does not get the context it set when it was registered #721

Open
giuliomoro opened this issue Jul 13, 2023 · 0 comments

Comments

@giuliomoro
Copy link
Contributor

e.g.:

let controlCallback = (data) => {
     console.log(this);
}
Bela.control.registerCallback("controlCallback", controlCallback, { val: 1, otherval: 2});

prints

Window [window: Window(0), self: Window(0), document: document, name: '', location: Location, …]

I don't see any obvious issue in BelaControl.js:

		Object.values(this.callbacks).forEach( c  => c.function.call(c.object, parsedData) );

seems to be doing what it's meant to, but call() doesn't seem to set c.object as this as it should.

@giuliomoro giuliomoro changed the title Gui: on the frontend, the control callback does not get the this it set when it got registered Gui: on the frontend, the control callback does not get the context it set when it was registered Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant