Skip to content

Conflicting SELECTION events #70

@benloh

Description

@benloh

In qa'ing #68, we discovered a minor bug where clicking on a node when setting a source or target during an edge edit would inadvertently cancel the edit and select the node instead.

To replicate:

  1. Select an edge.
  2. Click "Edit Edge"
  3. Click "Change Target" or "Change Source", whichever is available.
  4. Click in the AutoComplete field like you're about to type the node name
  5. Change your mind and click on the node in the graph instead.
  6. The edge edit will exit and instead the node you clicked in the graph will be selected and displayed.

This bug is an instance where multiple events are triggering conflicting actions. When you click on the node in the graph, two different events are triggered:

a. The AutoComplete field triggers an onBlur event because the field has lost the focus. This triggers a SELECTION event.
b. The node you clicked on in the graph triggers a second SELECTION event.

The two SELECTION events conflict with each other. What happens in practice is the AutoComplete onBlur event is triggered first, so the clicked-on node is selected (and all corresponding edges deselected/selected). By the time the EdgeEditor receives the graph click/selection event, the edge being edited is already gone.

The AutoComplete blur functionality was there to allow users to select a node by simply typing the name and tabbing out.

Tentative Solution

The quick fix solution is to remove the onBlur functionality. The functionality was problematic to begin with because hitting Return when typing in AutoComplete during an Edge Edit actually triggers an Edge Submit, so the typed-in edge isn't even selected. But this affects other functionality elsewhere. See Implications below.

Implications

  • You can still type in any AutoComplete field. But selection now requires an explicit click from the suggestions list.
  • If you want to use keyboard only, you can still use the arrow keys to select an item in the suggestions list, hitting return to select it.
  • The onBlur wasn't being properly triggered

We need to explore alternative approaches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions