Prevent node autocomplete from autohiding#11487
Merged
mmisol merged 3 commits intoDynamoDS:masterfrom Feb 11, 2021
Merged
Conversation
This happened when the amount of suggestions for an input surpassed a certain number of suggestions. The cause was the following condition. It turns out that popups, like autocomplete, close when the left mouse button up event happens. The problem is that autocomplete itself is launched by pressing the left mouse button. This would normally mean that the popup would hide as soon as the button was released, but this was actually prevented through a time condition, which ignored the event if it was 'soon enough'. Unfortunately, in cases where there were a lot of suggestions, the left mouse button up event can come after the expected timespan. This resulted in the workaround failing to prevent the popup from hiding immediately. The newly implemented solution replaces the previous time-based workaround with a more robust solution, which is to ignore the next event after the call to show the popup is made.
QilongTang
reviewed
Feb 10, 2021
| ViewModel.RequestAddViewToOuterCanvas += vm_RequestAddViewToOuterCanvas; | ||
| ViewModel.WorkspacePropertyEditRequested += VmOnWorkspacePropertyEditRequested; | ||
| ViewModel.RequestSelectionBoxUpdate += VmOnRequestSelectionBoxUpdate; | ||
| ViewModel.RequestNodeAutoCompleteSearch += ShowHideNodeAutoCompleteControl; |
Contributor
There was a problem hiding this comment.
I remember this was added so that Node AutoComplete works for custom node workspace. Any reason of removing this? If intended, would you test using node autocomplete in a new custom node?
Collaborator
Author
There was a problem hiding this comment.
I see. This was causing the Show function to be called two times in a row. I can add it back to avoid affecting custom nodes, but it does seem suspicious.
Collaborator
Author
There was a problem hiding this comment.
Instead of removing this handler assignment I removed the other one. Tested in both standard and custom node workspace and it's working. This also prevents the existing behaviour of the handler being called twice on standard workspaces.
QilongTang
approved these changes
Feb 11, 2021
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.
Purpose
This happened when the amount of suggestions for an input surpassed a
certain number of suggestions. The cause was the following condition.
It turns out that popups, like autocomplete, close when the left mouse
button up event happens. The problem is that autocomplete itself is
launched by pressing the left mouse button. This would normally mean
that the popup would hide as soon as the button was released, but this
was actually prevented through a time condition, which ignored the
event if it was 'soon enough'.
Unfortunately, in cases where there were a lot of suggestions, the left
mouse button up event can come after the expected timespan. This
resulted in the workaround failing to prevent the popup from hiding
immediately.
The newly implemented solution replaces the previous time-based
workaround with a more robust solution, which is to ignore the next
event after the call to show the popup is made.
Declarations
Check these if you believe they are true
*.resxfiles