()
| 251 | }; |
| 252 | |
| 253 | let onFocus = () => { |
| 254 | enteredKeys.current = ''; |
| 255 | if (ref.current) { |
| 256 | scrollIntoViewport(ref.current, {containingElement: getScrollParent(ref.current)}); |
| 257 | } |
| 258 | |
| 259 | // Collapse selection to start or Chrome won't fire input events. |
| 260 | let selection = window.getSelection(); |
| 261 | selection?.collapse(ref.current); |
| 262 | }; |
| 263 | |
| 264 | let documentRef = useRef(typeof document !== 'undefined' ? document : null); |
| 265 | useEvent(documentRef, 'selectionchange', () => { |
nothing calls this directly
no test coverage detected