Focusing in and out of canvas

Hi,
We are trying to implement an iFrame inside our application. We are able to get the focus out of the canvas into the iFrame using JavaScript.

Sample Code:

var iframe = element.querySelector("iframe");
iframe.focus();

Now, we are not able to go back into the Canvas / Our application.

Please, suggest any solution on this.

Hi,

Once you’re in the iframe, you need to get back to the parent document. You should be able to do
parent.document.querySelector('canvas').focus();