From 1d9c033dd51eb8e97b7b37ecbbe056a9b2738882 Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 26 Feb 2021 15:00:29 +0100 Subject: [PATCH] fix(focusringcontext): invalidate after context mutation thru showElement() --- src/FocusRingContext.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FocusRingContext.tsx b/src/FocusRingContext.tsx index bbd7fe5..dbda27f 100644 --- a/src/FocusRingContext.tsx +++ b/src/FocusRingContext.tsx @@ -40,7 +40,6 @@ export class FocusRingContextManager { } showElement(element: Element, opts: FocusRingShowOpts = {}) { - this.invalidate(); this.targetElement = element; this.targetAncestry = this.getElementAncestors(this.targetElement); this.boundingBox = undefined; @@ -48,16 +47,17 @@ export class FocusRingContextManager { this.offset = opts.offset ?? 0; this.zIndex = opts.zIndex; setActiveRingContextManager(this); + this.invalidate(); } hide() { - this.invalidate(); this.targetElement = undefined; this.targetAncestry = undefined; this.boundingBox = undefined; this.className = undefined; this.offset = 0; this.zIndex = undefined; + this.invalidate(); } get visible() {