fix(ui): fix add node autoconnect (#5434)

## What type of PR is this? (check all applicable)

- [ ] Refactor
- [ ] Feature
- [x] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
- [ ] Community Node Submission


## Description

The new select component appears to close itself before calling the
onchange handler. This short-circuits the autoconnect logic. Tweaked so
the ordering is correct.

## Related Tickets & Documents

<!--
For pull requests that relate or close an issue, please include them
below. 

For example having the text: "closes #1234" would connect the current
pull
request to issue 1234.  And when we merge the pull request, Github will
automatically close the issue.
-->

- Closes #5425

## QA Instructions, Screenshots, Recordings

bug should be fixed

<!-- 
Please provide steps on how to test changes, any hardware or 
software specifications as well as any other pertinent information. 
-->

## Merge Plan

This PR can be merged when approved

<!--
A merge plan describes how this PR should be handled after it is
approved.

Example merge plans:
- "This PR can be merged when approved"
- "This must be squash-merged when approved"
- "DO NOT MERGE - I will rebase and tidy commits before merging"
- "#dev-chat on discord needs to be advised of this change when it is
merged"

A merge plan is particularly important for large PRs or PRs that touch
the
database in any way.
-->
This commit is contained in:
blessedcoolant 2024-01-07 08:32:52 +05:30 committed by GitHub
commit ebda81e96e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -155,8 +155,9 @@ const AddNodePopover = () => {
return;
}
addNode(v.value);
dispatch(addNodePopoverClosed());
},
[addNode]
[addNode, dispatch]
);
const onClose = useCallback(() => {
@ -235,6 +236,7 @@ const AddNodePopover = () => {
onMenuClose={onClose}
onKeyDown={onKeyDown}
inputRef={inputRef}
closeMenuOnSelect={false}
/>
</InvPopoverBody>
</InvPopoverContent>