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