Skip to content

feat/PR request: onOutputReady event #83

Open
@DavidScales

Description

@DavidScales

I'm using Kotlin Playground in an iframe, and I need to expand the iframe size based on the height of the playground.

Right now I can update the iframe size with postMessage. I use the onChange event to check if the playground height has changed (from user's editing code) and update the iframe height accordingly.

When the code is compiled and output or exceptions are displayed in the output window, the output window expands to an arbitrary size. Right now I have no way of knowing when that's happened.

I can use the onConsoleOpen event to check when the console has been opened, but when an onConsoleOpen callback is defined, it's fired during the "waitingForOutput" stage:

this.update({
      waitingForOutput: true,
      openConsole: false
});
if (onOpenConsole) onOpenConsole(); //open when waitingForOutput=true

Which is before the actual output/exceptions have been returned, and thus before the final height of the console/output window have been set.

I'm willing to make a PR to create some kind of "onOutputReady" event, if you're open to the idea?

Or of you have a better approach, I'm open to that too. Thanks!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions