Buckets:
Quantumbraid/trainingdata / ui /node_modules /@headlessui /react /dist /hooks /use-refocusable-input.js
| import{useRef as r}from"react";import{useEvent as u}from'./use-event.js';import{useEventListener as o}from'./use-event-listener.js';function i(e){let n=r({value:"",selectionStart:null,selectionEnd:null});return o(e,"blur",l=>{let t=l.target;t instanceof HTMLInputElement&&(n.current={value:t.value,selectionStart:t.selectionStart,selectionEnd:t.selectionEnd})}),u(()=>{if(document.activeElement!==e&&e instanceof HTMLInputElement&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==n.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:l,selectionEnd:t}=n.current;l!==null&&t!==null&&e.setSelectionRange(l,t)}n.current={value:"",selectionStart:null,selectionEnd:null}}})}export{i as useRefocusableInput}; | |
Xet Storage Details
- Size:
- 747 Bytes
- Xet hash:
- 3243f916c5855670d9186e59ea6ee2ab868c2ac3233333b025f64b565fbc21b7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.