mirror of https://github.com/status-im/js-waku.git
Do not send message if a modifier is pressed to enable multiline msgs
This commit is contained in:
parent
8073021d82
commit
c293e268e8
|
@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- Test: Upgrade nim-waku node to v0.4.
|
||||
- Waku Light Push upgraded to `2.0.0-beta1`.
|
||||
- Examples (web chat): Catch error if chat message decoding fails.
|
||||
- Examples (web chat): Do not send message if shift/alt/ctrl is pressed, enabling multiline messages.
|
||||
|
||||
## [0.6.0] - 2021-06-09
|
||||
|
||||
|
|
|
@ -29,7 +29,12 @@ export default function MessageInput(props: Props) {
|
|||
};
|
||||
|
||||
const keyPressHandler = async (event: KeyboardEvent<HTMLInputElement>) => {
|
||||
if (event.key === 'Enter') {
|
||||
if (
|
||||
event.key === 'Enter' &&
|
||||
!event.altKey &&
|
||||
!event.ctrlKey &&
|
||||
!event.shiftKey
|
||||
) {
|
||||
await sendMessage();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue