Need to select twice when deleting in a iframe

I don’t know it is for all iframes or only for iframe gerenated by React. If I am using gojs in a iframe, I have to select a certain node twice before I can really delete it by using del key. It works fine if I am not in the iframe. However, if hosted in iframe and only select once, I can see the selection event is triggered but the del key will not work. Any idea?

Also, when in a iframe, I cannot even hit SelectionDeleting event no matter whether I select once and twice.


That’s weird, I’m not sure why an iFrame would change anything here. Trying it on a very minimal sample, there seems to be no problem.


After investigating deeper, I find that doKeyDown event in command handler won’t be fired if only select once. Any possible reason why the first selection not start listening on this event?

What are you doing differently from the working example Simon provided? The best course of action is probably for you to simplify your app until things are working as expected to determine the cause of the problem.

The iframe is generated via ReactJS framework. Yes, I know Simon’s example works though it is hard for me to simplify my code that much. The question is what makes iframe swallow the keydown when select once. I can see the click event fired as well.

Unfortunately, that sounds like it’s outside the scope of GoJS. We are not experts in other libraries, so it’s hard to say how React could be affecting the events.