mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-02 20:06:06 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			7 lines
		
	
	
		
			305 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			7 lines
		
	
	
		
			305 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
export function initAutoFocusEnd() {
 | 
						|
  for (const el of document.querySelectorAll<HTMLInputElement>('.js-autofocus-end')) {
 | 
						|
    el.focus(); // expects only one such element on one page. If there are many, then the last one gets the focus.
 | 
						|
    el.setSelectionRange(el.value.length, el.value.length);
 | 
						|
  }
 | 
						|
}
 |