mi6 / mi6/ic-ui-kit

IcNavigationGroup keydown handler sometimes triggers when not in focus

Open
#4,172 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
53
Forks
63
Avg merge
2d 4h
Merged PRs (30d)
15

Description

### Summary of the bug
If you open an IcNavigationGroup dropdown with your mouse and close it with the enter key, the IcNavigationGroup will now reopen whenever enter is pressed, even if it is not in focus.

### 🪜 How to reproduce
Tell us the steps to reproduce the problem:
1. Visit the ["Grouped links" example on the ICDS site](https://design.sis.gov.uk/components/top-navigation/code#grouped-links) and open the example in StackBlitz
2. Hover over the "Accessibility" button in the navbar
3. Press the enter key to close the menu
4. Place your focus in the search bar (with keyboard or mouse click)
5. Press enter and observe the nav menu opening

### 🧐 Expected behaviour
The dropdown to not open on enter unless the navbar is in focus.

### 🚨 Urgency (low, medium or high)
Medium

Contributor guide

Open the contributing guide

Research direction

Start with the “Grouped links” example on the ICDS site and inspect the IcNavigationGroup keydown handling around the reported reproduction steps. Verify that closing the dropdown with Enter does not cause it to reopen when Enter is later pressed from the search bar or another unfocused element.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.