(e: ReactFocusEvent)
| 509 | }; |
| 510 | |
| 511 | let onFocus = (e: ReactFocusEvent) => { |
| 512 | if (!e.isTrusted) { |
| 513 | return; |
| 514 | } |
| 515 | |
| 516 | let curFocusedNode = queuedActiveDescendant.current |
| 517 | ? document.getElementById(queuedActiveDescendant.current) |
| 518 | : null; |
| 519 | if (curFocusedNode) { |
| 520 | let target = getEventTarget(e); |
| 521 | queueMicrotask(() => { |
| 522 | // instead of focusing the last focused node, just focus the collection instead and have the collection handle what item to focus via useSelectableCollection/Item |
| 523 | dispatchVirtualBlur(target, collectionRef.current); |
| 524 | dispatchVirtualFocus(collectionRef.current!, target); |
| 525 | }); |
| 526 | } |
| 527 | }; |
| 528 | |
| 529 | // Clicking back into the input can happen after focus moved elsewhere in the dialog, while |
| 530 | // virtual focus is still on an option. Clear virtual focus on pointer down so mouse |
nothing calls this directly
no test coverage detected