projectstorm / react-diagrams

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

Fix touch with mouse event bug on selection box usage #871

Closed vadimshvetsov closed 2 years ago

vadimshvetsov commented 2 years ago

Checklist

What?

Getting Uncaught TypeError: Cannot read properties of undefined (reading 'x') when using SelectionBox

Closes https://github.com/projectstorm/react-diagrams/issues/867

Why?

Because SelectionBox code uses interface as class with instanceof. It's always false.

How?

Remove instanceof usage and rely on object props.

Feel good image:

image