From aa879ef86b30e1ad3d6eede2b80c13b0ac1abc97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Tue, 12 May 2026 21:49:46 +0200 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9E=95=20Add=20input=20value=20on=20blur?= =?UTF-8?q?=20for=20TextInput?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TextInput.vue | 2 +- test/components/TextInput.test.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/TextInput.vue b/src/components/TextInput.vue index 854d33b..333cb7b 100644 --- a/src/components/TextInput.vue +++ b/src/components/TextInput.vue @@ -97,7 +97,7 @@ const onBlur = (evt: ElementEvent) => { validationMessage.value = ''; } - emit('blur'); + emit('blur', model.value); }; // not computed, we want this only on the initial load diff --git a/test/components/TextInput.test.js b/test/components/TextInput.test.js index bef15ed..9214fa9 100644 --- a/test/components/TextInput.test.js +++ b/test/components/TextInput.test.js @@ -338,6 +338,12 @@ describe('TextInput', () => { expect(wrapper.emitted().change, 'expected change event to have been emitted').toBeTruthy(); expect(wrapper.emitted()['change'].length).toBe(1); expect(textInput.element.value).toBe(inputText); + + // now blur and verify + await textInput.trigger('blur'); + expect(wrapper.emitted().blur, 'expected blur event to have been emitted').toBeTruthy(); + expect(wrapper.emitted()['blur'].length).toBe(1); + expect(wrapper.emitted()['blur'][0][0]).toBe(inputText); }); it('able to reset the text input using exposed reset method', async () => { From b2e5f0bec8a32f20209a5b99131fc38d7dc0a20c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Tue, 12 May 2026 21:51:08 +0200 Subject: [PATCH 2/4] =?UTF-8?q?=E2=9E=95=20Add=20input=20value=20on=20blur?= =?UTF-8?q?=20for=20TextArea?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TextArea.vue | 2 +- test/components/TextArea.test.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/TextArea.vue b/src/components/TextArea.vue index f395d2b..659a263 100644 --- a/src/components/TextArea.vue +++ b/src/components/TextArea.vue @@ -90,7 +90,7 @@ const onBlur = (evt: ElementEvent) => { validationMessage.value = ''; } - emit('blur'); + emit('blur', model.value); }; diff --git a/test/components/TextArea.test.js b/test/components/TextArea.test.js index 4e6b25f..98d5a48 100644 --- a/test/components/TextArea.test.js +++ b/test/components/TextArea.test.js @@ -199,6 +199,12 @@ describe('TextArea', () => { expect(wrapper.emitted().change, 'expected change event to have been emitted').toBeTruthy(); expect(wrapper.emitted()['change'].length).toBe(1); expect(textArea.element.value).toBe(inputText); + + // now blur and verify + await textArea.trigger('blur'); + expect(wrapper.emitted().blur, 'expected blur event to have been emitted').toBeTruthy(); + expect(wrapper.emitted()['blur'].length).toBe(1); + expect(wrapper.emitted()['blur'][0][0]).toBe(inputText); }); it('able to reset the text area using exposed reset method', async () => { From 40b1c3752df32502cad2af98bc66a230322989e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Tue, 12 May 2026 22:08:30 +0200 Subject: [PATCH 3/4] =?UTF-8?q?=E2=9E=95=20Add=20input=20value=20on=20blur?= =?UTF-8?q?=20for=20SelectInput?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SelectInput.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SelectInput.vue b/src/components/SelectInput.vue index 53f0fb4..07a2a2a 100644 --- a/src/components/SelectInput.vue +++ b/src/components/SelectInput.vue @@ -72,7 +72,7 @@ const onBlur = (evt: ElementEvent) => { validationMessage.value = ''; } - emit('blur'); + emit('blur', model.value); }; defineExpose({ focus, reset }); From 7b8f3e2fa310a49d315116f38f2242c8b90a4a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Wed, 13 May 2026 06:44:56 +0200 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=94=A8=20Emit=20event=20instead=20of?= =?UTF-8?q?=20input=20value?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SelectInput.vue | 2 +- src/components/TextArea.vue | 2 +- src/components/TextInput.vue | 2 +- test/components/TextArea.test.js | 2 +- test/components/TextInput.test.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/SelectInput.vue b/src/components/SelectInput.vue index 07a2a2a..286af36 100644 --- a/src/components/SelectInput.vue +++ b/src/components/SelectInput.vue @@ -72,7 +72,7 @@ const onBlur = (evt: ElementEvent) => { validationMessage.value = ''; } - emit('blur', model.value); + emit('blur', evt); }; defineExpose({ focus, reset }); diff --git a/src/components/TextArea.vue b/src/components/TextArea.vue index 659a263..f65b6b9 100644 --- a/src/components/TextArea.vue +++ b/src/components/TextArea.vue @@ -90,7 +90,7 @@ const onBlur = (evt: ElementEvent) => { validationMessage.value = ''; } - emit('blur', model.value); + emit('blur', evt); }; diff --git a/src/components/TextInput.vue b/src/components/TextInput.vue index 333cb7b..984c777 100644 --- a/src/components/TextInput.vue +++ b/src/components/TextInput.vue @@ -97,7 +97,7 @@ const onBlur = (evt: ElementEvent) => { validationMessage.value = ''; } - emit('blur', model.value); + emit('blur', evt); }; // not computed, we want this only on the initial load diff --git a/test/components/TextArea.test.js b/test/components/TextArea.test.js index 98d5a48..747c9c2 100644 --- a/test/components/TextArea.test.js +++ b/test/components/TextArea.test.js @@ -204,7 +204,7 @@ describe('TextArea', () => { await textArea.trigger('blur'); expect(wrapper.emitted().blur, 'expected blur event to have been emitted').toBeTruthy(); expect(wrapper.emitted()['blur'].length).toBe(1); - expect(wrapper.emitted()['blur'][0][0]).toBe(inputText); + expect(wrapper.emitted()['blur'][0][0].target.value).toBe(inputText); }); it('able to reset the text area using exposed reset method', async () => { diff --git a/test/components/TextInput.test.js b/test/components/TextInput.test.js index 9214fa9..9823845 100644 --- a/test/components/TextInput.test.js +++ b/test/components/TextInput.test.js @@ -343,7 +343,7 @@ describe('TextInput', () => { await textInput.trigger('blur'); expect(wrapper.emitted().blur, 'expected blur event to have been emitted').toBeTruthy(); expect(wrapper.emitted()['blur'].length).toBe(1); - expect(wrapper.emitted()['blur'][0][0]).toBe(inputText); + expect(wrapper.emitted()['blur'][0][0].target.value).toBe(inputText); }); it('able to reset the text input using exposed reset method', async () => {