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