feat: implement TooltipManager for managing tooltip lifecycle (#24236)

Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
AADI GUPTA 2025-08-22 08:12:48 +05:30 • committed by GitHub
commit 6b01b0b165
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 2 deletions

View file

@ -0,0 +1,16 @@
class TooltipManager {
private activeCloser: (() => void) | null = null
register(closeFn: () => void) {
if (this.activeCloser)
this.activeCloser()
this.activeCloser = closeFn
}
clear(closeFn: () => void) {
if (this.activeCloser === closeFn)
this.activeCloser = null
}
}
export const tooltipManager = new TooltipManager()