Skip to content

Store the dialog opener with useRef #52

Description

@coderabbitai

Summary

Replace the unused useState setter for the dialog opener with a useRef.

Required changes

  • Store document.activeElement as the dialog opener in a ref.
  • Preserve focus return and cleanup behavior.

Affected areas

  • use-dialog-focus.ts

Acceptance criteria

  • The opener is tracked without an unused state setter.
  • Dialog close still returns focus to the opener.

Source

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions