ignore arrows events when the textarea is selected

Fixes #1416
pull/1421/head
Audric Ackermann 5 years ago
parent 16c9bf27c9
commit d2fab26a5d
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -709,6 +709,9 @@ export class SessionCompositionBox extends React.Component<Props, State> {
await this.onSendMessage();
} else if (event.key === 'Escape' && this.state.showEmojiPanel) {
this.hideEmojiPanel();
} else if (event.key === 'PageUp' || event.key === 'PageDown') {
// swallow pageUp events if they occurs on the composition box (it breaks the app layout)
event.preventDefault();
}
}

@ -307,6 +307,7 @@ export class SessionConversation extends React.Component<Props, State> {
/> */}
<div
// if you change the classname, also update it on onKeyDown
className={classNames(
'conversation-content',
selectionMode && 'selection-mode'
@ -888,6 +889,7 @@ export class SessionConversation extends React.Component<Props, State> {
}
// EXIT WHAT ELSE?
}
if (event.target.classList.contains('conversation-content')) {
switch (event.key) {
case 'Escape':
if (selectionMode) {
@ -910,6 +912,7 @@ export class SessionConversation extends React.Component<Props, State> {
default:
}
}
}
private clearAttachments() {
this.state.stagedAttachments.forEach(attachment => {

Loading…
Cancel
Save