projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.6k stars 1.17k forks source link

fix: MacOS Screenshot Issue #775

Closed nmkettler closed 3 years ago

nmkettler commented 3 years ago

Checklist

What?

The CanvasWidget locks up after taking a screenshot on MacOS.

Why?

This can be replicated by Shift + Cmd + 4. The canvas "freezing" occurs because it pops up Preview as you're letting go of the shift key, and the browser doesn't detect the key up event

How?

This clears the Action Event Bus keys on keydown so the screenshot will still take but not lock the canvas (shoutout to chaiyixiao for the help with this too)

Feel good image:

LOL

dylanvorster commented 3 years ago

I still have this issue, but want to find a better way to solve this, perhaps with some kind of OS adapter on the event bus