Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabs component binds the same method multiple times #2896

Closed
1 task done
romaricpascal opened this issue Oct 4, 2022 · 1 comment
Closed
1 task done

Tabs component binds the same method multiple times #2896

romaricpascal opened this issue Oct 4, 2022 · 1 comment
Labels
Milestone

Comments

@romaricpascal
Copy link
Member

romaricpascal commented Oct 4, 2022

What

The tabs component binds the onTabClick and onTabKeydown listeners multiple times, while only a single version of that bound method is necessary.

Furthermore, it stores each bound version on the $tab element, poluting the object from the DOM.

These methods could be bound only once before looping and stored on the component instead.

Why

Avoid unnecessary extra functions being created and poluting objects from the browser.

Who needs to work on this

Developers

Who needs to review this

Developers

Done when

  • The method is bound prior to looping and stored on the component rather than the element
@romaricpascal romaricpascal added the awaiting triage Needs triaging by team label Oct 4, 2022
@36degrees
Copy link
Contributor

Fixed by #2987 (478f642)

@36degrees 36degrees added this to the [NEXT] milestone Feb 10, 2023
@36degrees 36degrees moved this from Backlog 🗄 to Ready to release 🚀 in GOV.UK Design System cycle board Feb 10, 2023
@36degrees 36degrees added tabs and removed awaiting triage Needs triaging by team labels Feb 10, 2023
@querkmachine querkmachine moved this from Ready to release 🚀 to Done 🏁 in GOV.UK Design System cycle board Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants