projectstorm / react-diagrams

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

Fix smart routing selection issue #809

Closed vadimshvetsov closed 3 years ago

vadimshvetsov commented 3 years ago

Checklist

What?

If you will check smart routing demo you will find out that PathFindingLink becomes selected even when you moving mouse quite far from the path.

screenshot

Why?

The issue lays in DefaultLinkFactory which sets pointer-events: all to the actual path.

How?

I see two possible options for fix it:

  1. Extend PathFindingLinkFactory with generateLinkSegment method for overriding DefaultLinkFactory one
  2. Change path pointer-events style from all to auto in DefaultLinkFactory

I've chosen the second one because see no reason to have pointer-events: all there.

Feel good image:

LOL