Skip to content

Commit b8b2e79

Browse files
authored
Update README with focus handling details (#1646)
Clarified behavior of focus-related functions regarding initial focus delays.
1 parent b5d7f7b commit b8b2e79

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ A function that will be called **before** sending focus to the target element up
105105
() => void
106106
```
107107

108-
A function that will be called **after** sending focus to the target element upon activation.
108+
A function that will be called **after** sending focus to the target element upon activation **unless** initial focus is delayed because the [delayInitialFocus](#delayinitialfocus) is true (default).
109109

110110
##### onPause
111111

@@ -139,6 +139,8 @@ A function that will be called immediately after the trap's state is updated to
139139

140140
A function that will be called after the trap has been completely unpaused and is once again managing/trapping focus.
141141

142+
Note that if [delayInitialFocus](#delayinitialfocus) is true, this handler will be called **before** focus is re-set on the initial focused node.
143+
142144
##### checkCanFocusTrap
143145

144146
```typescript
@@ -267,6 +269,8 @@ boolean
267269

268270
Default: `true`. Delays the autofocus to the next execution frame when the focus trap is activated. This prevents elements within the focusable element from capturing the event that triggered the focus trap activation.
269271

272+
🔺 Note that when this option is `true` (default), it means the initial element to be focused will not be focused until **after** [onPostActivate](#onpostactivate) or [onPostUnpause](#onpostunpause) are called.
273+
270274
##### document
271275

272276
```typescript

0 commit comments

Comments
 (0)