uber / react-digraph

A library for creating directed graph editors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

On Firefox, clicking on the nodes' text does not select the node

Djazouli opened this issue · comments

Describe the bug
When you click on a node, it becomes selected (the default behaviour is that it becomes blue). But if you use Firefox and click on the text of the node, then it won't be selected.

To Reproduce
Steps to reproduce the behavior:

  1. Download the starting example, and open it in Firefox
  2. Click on the node text (on black pixels)
  3. The node will flicker but won't be selected

Expected behavior
I was expecting the node to be selected.

Screenshots
The pixel I'm clicking on.
Screenshot 2020-08-26 at 16 04 05

Desktop (please complete the following information):

  • OS: macOS Catalina & Windows 10
  • Browser Firefox
  • Version 79.0

Additional context
After some debugging on my own, I realized that clicking on the text triggers two events. One which is the classic onNodeSelected event, with the node passed as parameter, but also another onNodeSelected event, with null as parameter, triggered by handleSvgClicked from GraphView. Thus, the node becomes selected for a small time, but it is reset almost instantly.
For the time being, debouncing onNodeSelected works as a temporary fix.
Note that the text is small on the example, so it's hard to trigger. But for someone using a custom renderNodeText, the issue might be bigger.

This should be fixed in 7.0.0-alpha.5, please test that out and let me know. Feel free to close the ticket if it works better.

Indeed, it is now working, thanks !