(e: FocusEvent<HTMLInputElement>)
| 267 | }); |
| 268 | |
| 269 | let onBlur = (e: FocusEvent<HTMLInputElement>) => { |
| 270 | let blurFromButton = buttonRef?.current && buttonRef.current === e.relatedTarget; |
| 271 | let blurIntoPopover = nodeContains(popoverRef.current, e.relatedTarget); |
| 272 | // Ignore blur if focused moved to the button(if exists) or into the popover. |
| 273 | if (blurFromButton || blurIntoPopover) { |
| 274 | return; |
| 275 | } |
| 276 | |
| 277 | if (props.onBlur) { |
| 278 | props.onBlur(e); |
| 279 | } |
| 280 | |
| 281 | state.setFocused(false); |
| 282 | }; |
| 283 | |
| 284 | let onFocus = (e: FocusEvent<HTMLInputElement>) => { |
| 285 | if (state.isFocused) { |
nothing calls this directly
no test coverage detected