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
Acceptance criteria
- The opener is tracked without an unused state setter.
- Dialog close still returns focus to the opener.
Source
Summary
Replace the unused
useStatesetter for the dialog opener with auseRef.Required changes
document.activeElementas the dialog opener in a ref.Affected areas
use-dialog-focus.tsAcceptance criteria
Source