Skip to content

Commit

Permalink
Merge pull request #4 from waxandwane/fix/focus-ring-with-targets
Browse files Browse the repository at this point in the history
fix(focusringcontext): invalidate after context mutation thru showElement()
  • Loading branch information
faultyserver committed Mar 4, 2021
2 parents 2b1c742 + 1d9c033 commit 3649ec4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/FocusRingContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,24 @@ export class FocusRingContextManager {
}

showElement(element: Element, opts: FocusRingShowOpts = {}) {
this.invalidate();
this.targetElement = element;
this.targetAncestry = this.getElementAncestors(this.targetElement);
this.boundingBox = undefined;
this.className = opts.className;
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() {
Expand Down

0 comments on commit 3649ec4

Please sign in to comment.