You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OcTooltip registers a document keydown listener per element #3171
The v-oc-tooltip directive (packages/design-system/src/directives/OcTooltip.ts) registers a keydown listener on document for every element it is bound to, and only removes it on unmount.
File list rows are never unmounted once revealed, so the listener count grows with every item scrolled past.
Measured on a 500-row table:
document keydown listeners
after initial load
135
after scrolling through all 500 rows
3021
That is about 6 per row.
Why this is bad
Every keystroke anywhere in the app fans out to three thousand handlers, each of which only needs to check for Escape. It gets worse the longer a session runs and the more large folders are visited. There is no upper bound.
Proposed solution
Register a single shared keydown handler for the directive that closes whichever tooltip is currently open, instead of one handler per bound element. The per-element mouseenter/mouseleave/focus/blur/click listeners can stay as they are.
Verification
document keydown listener count stays constant across a full scroll pass through a large folder.
Activity