diff --git a/app/gui2/e2e/componentBrowser.spec.ts b/app/gui2/e2e/componentBrowser.spec.ts
index e1bf270b38f..4abbe6ca765 100644
--- a/app/gui2/e2e/componentBrowser.spec.ts
+++ b/app/gui2/e2e/componentBrowser.spec.ts
@@ -39,16 +39,16 @@ test('Different ways of opening Component Browser', async ({ page }) => {
// (+) button
await locate.addNewNodeButton(page).click()
await expectAndCancelBrowser(page, '')
+ // (+) button with selection (ignored)
+ await locate.graphNodeByBinding(page, 'final').click()
+ await locate.addNewNodeButton(page).click()
+ await expectAndCancelBrowser(page, '')
// Enter key
await locate.graphEditor(page).press('Enter')
await expectAndCancelBrowser(page, '')
// With source node
- // (+) button
- await locate.graphNodeByBinding(page, 'final').click()
- await locate.addNewNodeButton(page).click()
- await expectAndCancelBrowser(page, '', 'final')
// Enter key
await locate.graphNodeByBinding(page, 'final').click()
await locate.graphEditor(page).press('Enter')
@@ -117,7 +117,7 @@ test('Graph Editor pans to Component Browser', async ({ page }) => {
})
test('Accepting suggestion', async ({ page }) => {
- // Clicking enry
+ // Clicking entry
await actions.goToGraph(page)
await locate.addNewNodeButton(page).click()
let nodeCount = await locate.graphNode(page).count()
diff --git a/app/gui2/src/components/GraphEditor.vue b/app/gui2/src/components/GraphEditor.vue
index 3e19c45fbd0..199bf786272 100644
--- a/app/gui2/src/components/GraphEditor.vue
+++ b/app/gui2/src/components/GraphEditor.vue
@@ -496,6 +496,11 @@ function addNodeAuto() {
createWithComponentBrowser(fromSelection() ?? { placement: { type: 'viewport' } })
}
+function addNodeDisconnected() {
+ nodeSelection.deselectAll()
+ createWithComponentBrowser({ placement: { type: 'viewport' } })
+}
+
function fromSelection(): NewNodeOptions | undefined {
if (graphStore.editedNodeInfo != null) return undefined
const firstSelectedNode = set.first(nodeSelection.selected)
@@ -715,7 +720,7 @@ const groupColors = computed(() => {
@collapseNodes="collapseNodes"
@removeNodes="deleteSelected"
/>
-
+