Accept the double-click the empty canvas asks for - #220
Merged
Conversation
The canvas prints "Double-click to add an entity" when a spec has no entities, but that is exactly when no vis network exists to carry a doubleClick: the container is replaced with the message and nothing listens. The invitation could not be followed at the one moment it was offered.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The builder canvas prints "Double-click to add an entity" whenever a spec has no entities. That is precisely when no vis network exists to carry a
doubleClick: the container is replaced with the message div and nothing is listening, so the invitation cannot be followed at the one moment it is offered.The empty canvas now wires the double-click to the container itself, and clears it again once a network exists so a double-click on a node does not also open the modal.
Covered by a browser test that resets to an empty spec, double-clicks the message, and waits for the add-entity modal — red before the change.