From 26e43e01aff5a2b425d55dc5035e060a81be7955 Mon Sep 17 00:00:00 2001
From: Alexander Brown <448862+DrJKL@users.noreply.github.com>
Date: Sat, 17 Jan 2026 15:01:47 -0800
Subject: [PATCH] fix: Consistent keydown use for EditableText events.
---
src/components/common/EditableText.test.ts | 10 +++++-----
src/components/common/EditableText.vue | 4 ++--
.../extensions/vueNodes/components/NodeHeader.test.ts | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/components/common/EditableText.test.ts b/src/components/common/EditableText.test.ts
index 2d31123b9..df1ea5152 100644
--- a/src/components/common/EditableText.test.ts
+++ b/src/components/common/EditableText.test.ts
@@ -51,7 +51,7 @@ describe('EditableText', () => {
isEditing: true
})
await wrapper.findComponent(InputText).setValue('New Text')
- await wrapper.findComponent(InputText).trigger('keyup.enter')
+ await wrapper.findComponent(InputText).trigger('keydown.enter')
// Blur event should have been triggered
expect(wrapper.findComponent(InputText).element).not.toBe(
document.activeElement
@@ -79,7 +79,7 @@ describe('EditableText', () => {
await wrapper.findComponent(InputText).setValue('Modified Text')
// Press escape
- await wrapper.findComponent(InputText).trigger('keyup.escape')
+ await wrapper.findComponent(InputText).trigger('keydown.escape')
// Should emit cancel event
expect(wrapper.emitted('cancel')).toBeTruthy()
@@ -103,7 +103,7 @@ describe('EditableText', () => {
await wrapper.findComponent(InputText).setValue('Modified Text')
// Press escape (which triggers blur internally)
- await wrapper.findComponent(InputText).trigger('keyup.escape')
+ await wrapper.findComponent(InputText).trigger('keydown.escape')
// Manually trigger blur to simulate the blur that happens after escape
await wrapper.findComponent(InputText).trigger('blur')
@@ -120,7 +120,7 @@ describe('EditableText', () => {
isEditing: true
})
await enterWrapper.findComponent(InputText).setValue('Saved Text')
- await enterWrapper.findComponent(InputText).trigger('keyup.enter')
+ await enterWrapper.findComponent(InputText).trigger('keydown.enter')
// Trigger blur that happens after enter
await enterWrapper.findComponent(InputText).trigger('blur')
expect(enterWrapper.emitted('edit')).toBeTruthy()
@@ -133,7 +133,7 @@ describe('EditableText', () => {
isEditing: true
})
await escapeWrapper.findComponent(InputText).setValue('Cancelled Text')
- await escapeWrapper.findComponent(InputText).trigger('keyup.escape')
+ await escapeWrapper.findComponent(InputText).trigger('keydown.escape')
expect(escapeWrapper.emitted('cancel')).toBeTruthy()
expect(escapeWrapper.emitted('edit')).toBeFalsy()
})
diff --git a/src/components/common/EditableText.vue b/src/components/common/EditableText.vue
index ba4340913..440935fb9 100644
--- a/src/components/common/EditableText.vue
+++ b/src/components/common/EditableText.vue
@@ -3,7 +3,7 @@
{{ modelValue }}
-
+
{
// Edit and confirm (EditableText uses blur or enter to emit)
const input = wrapper.get('[data-testid="node-title-input"]')
await input.setValue('My Custom Sampler')
- await input.trigger('keyup.enter')
+ await input.trigger('keydown.enter')
await input.trigger('blur')
// NodeHeader should emit update:title with trimmed value