fix: remove missing resize event listener cleanup and fix copy button aria-label#727
Open
immanuwell wants to merge 1 commit into
Open
fix: remove missing resize event listener cleanup and fix copy button aria-label#727immanuwell wants to merge 1 commit into
immanuwell wants to merge 1 commit into
Conversation
… aria-label Signed-off-by: immanuwell <pchpr.00@list.ru>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two bugs fixed:
window.addEventListener('resize', updatePageSize)was called insideuseEffectwithout a cleanup in 5 components. Every time deps changed (page, alignment, data), a new listener piled on top. On a busy session that's a real leak - stale handlers keep firing and updating state on unmounted components.The copy-token
IconButtonindeveloper/tokenshadaria-label="delete"- copy-paste error, screen readers called it "delete".Related Issue
No open issue found for these.
Motivation and Context
Fix 1: added
return () => window.removeEventListener('resize', updatePageSize)in each effect. For schedulers/seed-peers whereupdatePageSizewas scoped insideif (alignment === 'card'), moved it one level up so it's reachable from the cleanup (callingremoveEventListeneron a never-registered listener is a safe no-op).Fix 2: changed
aria-label="delete"toaria-label="copy".How to reproduce
Leak: open the clusters or schedulers page in card view, resize the window, then navigate away and back a few times. Each render cycle adds another resize handler with no cleanup.
Aria label: inspect the copy-token button with devtools or a screen reader - it was announced as "delete".
Types of changes
Checklist