()
| 60 | * Toggle focus between scroll and input areas |
| 61 | */ |
| 62 | const toggleFocus = () => { |
| 63 | if (!canToggleFocus) { |
| 64 | return |
| 65 | } |
| 66 | |
| 67 | const prev = manualFocus |
| 68 | if (prev === "scroll") { |
| 69 | setManualFocus("input") |
| 70 | } else if (prev === "input") { |
| 71 | setManualFocus("scroll") |
| 72 | } else { |
| 73 | setManualFocus(isScrollAreaActive ? "input" : "scroll") |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | return { |
| 78 | canToggleFocus, |