stable

Clone or download

Read-only

fix: don't trigger shortcuts from lazybox search input

closes request #36481 Typing quick service access shortcuts in custom elements inputs kicks keyboard shortcuts keyDown events are forbidden from bubbling up outside of the lazybox search input. There is no need to listen to them as the callback given in lazybox options is enough to react to entered text and trigger autocompletions. Those events should be internal to the lazybox component. Letting them bubble up caused interferences with the global event listeners for keyboard shortcuts. Code dealing with global shortcuts always checks that the event target is not an input or a select or textarea, but when such elements are inside Shadow DOM, they cannot recognize it anymore, as the event target is replaced by the wrapping custom element ("tuleap-lazybox-search"). How to reproduce: - Find a lazybox custom element (links field in artifact-modal, reviewers/labels selector in PR overview, filter selector in new PR homepage) - Focus the search input, hold "g" and type "e" quickly --> The keyboard shortcut "Go to TestManagement" is triggered. How to test: - Repeat the same steps as mentionned above --> No shortcut is triggered. Change-Id: I7e966bb3c124ccd2ce5fe558846069b18b8019c1

Modified Files

Name
M lib/frontend/lazybox/src/SearchInput.test.ts +12 −1 Go to diff View file
M lib/frontend/lazybox/src/SearchInput.ts +5 −0 Go to diff View file