mi6 / mi6/ic-ui-kit

Improve event listeners in ic-navigation-button component

Open
#342 0 comments 0 reactions 0 assignees View on GitHub
component: ic-top-navigation
Dominant language
TypeScript
Stars
53
Forks
63
Avg merge
2d 4h
Merged PRs (30d)
15

Description

## What is the purpose of the work?
To reduce scope of target for listening to icNavigationMenuOpened and icNavigationMenuClosed events.

## Why do we need it?
Currently the ic-navigation-button listens to the icNavigationMenuOpened and icNavigationMenuClosed events at the document level. This means that code in unnecessarily run when there are multiple ic-top-navigation components on a page.

This is relatively unlikely in practice, but does affect the guidance site and storybook stories

## Additional information
This can be resolved by taking an approach similar to ic-navigation-item, where the listener is added on the parent element, rather than using the Stencil Listen decorator

Contributor guide

Open the contributing guide

Research direction

Start by locating the ic-navigation-button component and compare its event handling with ic-navigation-item. Check how ic-top-navigation establishes the parent relationship, then verify the navigation opened and closed events are handled only within that scope without unnecessary document-level work in the guidance site and Storybook stories.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.