Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/SelectInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const onBlur = (evt: ElementEvent<HTMLSelectElement>) => {
validationMessage.value = '';
}

emit('blur');
emit('blur', evt);
};

defineExpose({ focus, reset });
Expand Down
2 changes: 1 addition & 1 deletion src/components/TextArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const onBlur = (evt: ElementEvent<HTMLTextAreaElement>) => {
validationMessage.value = '';
}

emit('blur');
emit('blur', evt);
};
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/components/TextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const onBlur = (evt: ElementEvent<HTMLInputElement>) => {
validationMessage.value = '';
}

emit('blur');
emit('blur', evt);
};

// not computed, we want this only on the initial load
Expand Down
6 changes: 6 additions & 0 deletions test/components/TextArea.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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].target.value).toBe(inputText);
});

it('able to reset the text area using exposed reset method', async () => {
Expand Down
6 changes: 6 additions & 0 deletions test/components/TextInput.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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].target.value).toBe(inputText);
});

it('able to reset the text input using exposed reset method', async () => {
Expand Down
Loading