mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	fix textarea newline handle (#32966)
- Fix cursor position if input newline on middle of lines - ~Increment number if numbered list~  --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		@@ -92,6 +92,7 @@ function handleNewline(textarea: HTMLTextAreaElement, e: Event) {
 | 
			
		||||
  if (!line) {
 | 
			
		||||
    // clear current line if we only have i.e. '1. ' and the user presses enter again to finish creating a list
 | 
			
		||||
    textarea.value = value.slice(0, lineStart) + value.slice(lineEnd);
 | 
			
		||||
    textarea.setSelectionRange(selStart - prefix.length, selStart - prefix.length);
 | 
			
		||||
  } else {
 | 
			
		||||
    // start a new line with the same indention and prefix
 | 
			
		||||
    let newPrefix = prefix;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user