diff options
author | David Cho-Lerat <david.cho-lerat@sonarsource.com> | 2024-07-11 14:50:44 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-07-12 20:02:41 +0000 |
commit | f158ff6131dac0c332039c300ad2257d317d25c0 (patch) | |
tree | 2d149568e61796a69b6ccd40cb670549754a54f1 /server/sonar-web/src/main/js/helpers/keyboardEventHelpers.ts | |
parent | ee0a4d46fbb9565402219104df699a571e0f3bac (diff) | |
download | sonarqube-f158ff6131dac0c332039c300ad2257d317d25c0.tar.gz sonarqube-f158ff6131dac0c332039c300ad2257d317d25c0.zip |
SONAR-22453 Use DropdownMenu from Echoes
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/keyboardEventHelpers.ts')
-rw-r--r-- | server/sonar-web/src/main/js/helpers/keyboardEventHelpers.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/helpers/keyboardEventHelpers.ts b/server/sonar-web/src/main/js/helpers/keyboardEventHelpers.ts index 65ec4ba0fee..6a73fad10a0 100644 --- a/server/sonar-web/src/main/js/helpers/keyboardEventHelpers.ts +++ b/server/sonar-web/src/main/js/helpers/keyboardEventHelpers.ts @@ -36,3 +36,9 @@ export function isInput( event.target instanceof HTMLTextAreaElement ); } + +export function isDropdown(event: KeyboardEvent) { + const role = (event.target as HTMLElement | null)?.role ?? ''; + + return ['menu', 'menuitem'].includes(role); +} |