Fix sendbox enter not working

This commit is contained in:
miruka 2019-05-06 21:07:59 -04:00
parent 55e701c24d
commit eab5ae0afe
3 changed files with 9 additions and 5 deletions

View File

@ -1,13 +1,12 @@
- Refactoring - Refactoring
- Migrate more JS functions to their own files / Implement in Python instead - Migrate more JS functions to their own files / Implement in Python instead
- Don't bake in size properties for components - Don't bake in size properties for components
- Cleanup unused icons
- Bug fixes - Bug fixes
- Sendbox
- 100% CPU usage when hitting top edge to trigger messages loading - 100% CPU usage when hitting top edge to trigger messages loading
- Sending `![A picture](https://picsum.photos/256/256)` → not clickable? - Sending `![A picture](https://picsum.photos/256/256)` → not clickable?
- Icons and images aren't reloaded - Icons, images and HStyle singleton aren't reloaded
- HStyle singleton isn't reloaded
- `MessageDelegate.qml:63: TypeError: 'reloadPreviousItem' not a function` - `MessageDelegate.qml:63: TypeError: 'reloadPreviousItem' not a function`
- UI - UI

View File

@ -9,6 +9,7 @@ ScrollView {
default property alias textAreaData: textArea.data default property alias textAreaData: textArea.data
id: scrollView
clip: true clip: true
TextArea { TextArea {
@ -25,6 +26,8 @@ ScrollView {
id: textAreaBackground id: textAreaBackground
color: HStyle.controls.textArea.background color: HStyle.controls.textArea.background
} }
Keys.forwardTo: [scrollView]
} }
} }

View File

@ -40,6 +40,7 @@ HGlassRectangle {
area.onEditingFinished: setTyping(false) // when lost focus area.onEditingFinished: setTyping(false) // when lost focus
Keys.onReturnPressed: { Keys.onReturnPressed: {
console.log( "enter")
event.accepted = true event.accepted = true
if (event.modifiers & Qt.ShiftModifier || if (event.modifiers & Qt.ShiftModifier ||
@ -52,10 +53,11 @@ HGlassRectangle {
if (textArea.text === "") { return } if (textArea.text === "") { return }
Backend.clients.get(chatPage.userId) Backend.clients.get(chatPage.userId)
.sendMarkdown(chatPage.roomId, textArea.text) .sendMarkdown(chatPage.roomId, textArea.text)
textArea.clear() area.clear()
} }
Keys.onEnterPressed: Keys.onReturnPressed(event) // numpad enter // Numpad enter
Keys.onEnterPressed: Keys.onReturnPressed(event)
} }
} }
} }