Skip to content

fix(emoji-board): skip displayCheck on FocusTrap activation#820

Draft
Just-Insane wants to merge 1 commit into
SableClient:devfrom
Just-Insane:fix/emoji-board-focustrap
Draft

fix(emoji-board): skip displayCheck on FocusTrap activation#820
Just-Insane wants to merge 1 commit into
SableClient:devfrom
Just-Insane:fix/emoji-board-focustrap

Conversation

@Just-Insane
Copy link
Copy Markdown
Contributor

Description

focus-trap (used by the emoji board) runs a displayCheck by default on activation, which traverses the DOM to find tabbable elements. This can throw when elements have zero dimensions (e.g. immediately after mount before layout). Passing displayCheck: 'none' skips that check and lets the trap activate reliably.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code

FocusTrap's default displayCheck:'full' calls getComputedStyle() on every
tabbable element when the board opens. With hundreds of emoji buttons
in the visible groups this causes a multi-hundred ms freeze. Using
displayCheck:'none' skips that DOM traversal entirely while preserving
all keyboard-navigation and focus-trap behaviour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant