Fix ngbDropdown stealing keyboard events

This commit is contained in:
shamoon
2024-05-04 09:47:27 -07:00
parent c6e7d06bb7
commit b403b9d9d5
3 changed files with 108 additions and 85 deletions

View File

@@ -442,6 +442,13 @@ describe('GlobalSearchComponent', () => {
expect(focusSpy).toHaveBeenCalled()
})
it('should prevent event propagation for keyboard events on buttons that are not arrows', () => {
const event = { stopImmediatePropagation: jest.fn(), key: 'Enter' }
const stopPropagationSpy = jest.spyOn(event, 'stopImmediatePropagation')
component.onButtonKeyDown(event as any)
expect(stopPropagationSpy).toHaveBeenCalled()
})
it('should support explicit advanced search', () => {
const qfSpy = jest.spyOn(documentListViewService, 'quickFilter')
component.query = 'test'