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