Fix sendbox enter not working
This commit is contained in:
		
							
								
								
									
										5
									
								
								TODO.md
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								TODO.md
									
									
									
									
									
								
							@@ -1,13 +1,12 @@
 | 
			
		||||
- Refactoring
 | 
			
		||||
  - Migrate more JS functions to their own files / Implement in Python instead
 | 
			
		||||
  - Don't bake in size properties for components
 | 
			
		||||
  - Cleanup unused icons
 | 
			
		||||
 | 
			
		||||
- Bug fixes
 | 
			
		||||
  - Sendbox
 | 
			
		||||
  - 100% CPU usage when hitting top edge to trigger messages loading
 | 
			
		||||
  - Sending `` → not clickable?
 | 
			
		||||
  - Icons and images aren't reloaded
 | 
			
		||||
  - HStyle singleton isn't reloaded
 | 
			
		||||
  - Icons, images and HStyle singleton aren't reloaded
 | 
			
		||||
  - `MessageDelegate.qml:63: TypeError: 'reloadPreviousItem' not a function`
 | 
			
		||||
 | 
			
		||||
- UI
 | 
			
		||||
 
 | 
			
		||||
@@ -9,6 +9,7 @@ ScrollView {
 | 
			
		||||
 | 
			
		||||
    default property alias textAreaData: textArea.data
 | 
			
		||||
 | 
			
		||||
    id: scrollView
 | 
			
		||||
    clip: true
 | 
			
		||||
 | 
			
		||||
    TextArea {
 | 
			
		||||
@@ -25,6 +26,8 @@ ScrollView {
 | 
			
		||||
            id: textAreaBackground
 | 
			
		||||
            color: HStyle.controls.textArea.background
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        Keys.forwardTo: [scrollView]
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -40,6 +40,7 @@ HGlassRectangle {
 | 
			
		||||
            area.onEditingFinished: setTyping(false)  // when lost focus
 | 
			
		||||
 | 
			
		||||
            Keys.onReturnPressed: {
 | 
			
		||||
                console.log( "enter")
 | 
			
		||||
                event.accepted = true
 | 
			
		||||
 | 
			
		||||
                if (event.modifiers & Qt.ShiftModifier ||
 | 
			
		||||
@@ -52,10 +53,11 @@ HGlassRectangle {
 | 
			
		||||
                if (textArea.text === "") { return }
 | 
			
		||||
                Backend.clients.get(chatPage.userId)
 | 
			
		||||
                       .sendMarkdown(chatPage.roomId, textArea.text)
 | 
			
		||||
                textArea.clear()
 | 
			
		||||
                area.clear()
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            Keys.onEnterPressed: Keys.onReturnPressed(event)  // numpad enter
 | 
			
		||||
            // Numpad enter
 | 
			
		||||
            Keys.onEnterPressed: Keys.onReturnPressed(event)
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user