diff --git a/packages/primevue/src/tree/Tree.spec.js b/packages/primevue/src/tree/Tree.spec.js index 3abc504cb..d2b0b507a 100644 --- a/packages/primevue/src/tree/Tree.spec.js +++ b/packages/primevue/src/tree/Tree.spec.js @@ -47,12 +47,17 @@ describe('Tree.vue', () => { filter: true } }); + + let searchField = wrapper.find('input.p-inputtext'); + const key = 't'; + searchField.element.value = key; - let searchField = wrapper.find('input.p-inputtext'); - - await searchField.trigger('keydown.space'); + await searchField.trigger('keyup', { + key + }); expect(wrapper.emitted('filter')).toBeTruthy(); + expect(wrapper.emitted('filter')[0][0].value).toEqual(key); }); it('should render icon', ({ expect }) => { diff --git a/packages/primevue/src/tree/Tree.vue b/packages/primevue/src/tree/Tree.vue index db0474541..2c71a8371 100755 --- a/packages/primevue/src/tree/Tree.vue +++ b/packages/primevue/src/tree/Tree.vue @@ -9,7 +9,7 @@ - + @@ -172,7 +172,7 @@ export default { isNodeLeaf(node) { return node.leaf === false ? false : !(node.children && node.children.length); }, - onFilterKeydown(event) { + onFilterKeyup(event) { if (event.code === 'Enter' || event.code === 'NumpadEnter') { event.preventDefault(); }