add hw2
This commit is contained in:
		
							
								
								
									
										1
									
								
								node_modules/@headlessui/react/dist/hooks/use-refocusable-input.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@headlessui/react/dist/hooks/use-refocusable-input.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
import{useRef as u}from"react";import*as r from'../utils/dom.js';import{isActiveElement as o}from'../utils/owner.js';import{useEvent as s}from'./use-event.js';import{useEventListener as c}from'./use-event-listener.js';function v(e){let l=u({value:"",selectionStart:null,selectionEnd:null});return c(e,"blur",n=>{let t=n.target;r.isHTMLInputElement(t)&&(l.current={value:t.value,selectionStart:t.selectionStart,selectionEnd:t.selectionEnd})}),s(()=>{if(!o(e)&&r.isHTMLInputElement(e)&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==l.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:n,selectionEnd:t}=l.current;n!==null&&t!==null&&e.setSelectionRange(n,t)}l.current={value:"",selectionStart:null,selectionEnd:null}}})}export{v as useRefocusableInput};
 | 
			
		||||
		Reference in New Issue
	
	Block a user