| 154 | }; |
| 155 | |
| 156 | let onFocusOut: EventListener = e => { |
| 157 | if (isBlurFromActiveElement(getEventTarget(e) as Element) || isRefocusing) { |
| 158 | e.stopImmediatePropagation(); |
| 159 | |
| 160 | // If there was no focusable ancestor, we don't expect a focus event. |
| 161 | // Re-focus the original active element here. |
| 162 | if (!target && !isRefocusing) { |
| 163 | isRefocusing = true; |
| 164 | focusWithoutScrolling(activeElement); |
| 165 | cleanup(); |
| 166 | } |
| 167 | } |
| 168 | }; |
| 169 | |
| 170 | let onFocus: EventListener = e => { |
| 171 | if (isFocusMovingToTarget(getEventTarget(e) as Element) || isRefocusing) { |
nothing calls this directly
no test coverage detected