diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e316f039b..adf23ef2b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/examples/web-chat/src/MessageInput.tsx b/examples/web-chat/src/MessageInput.tsx index 3911bb873b..9322779d14 100644 --- a/examples/web-chat/src/MessageInput.tsx +++ b/examples/web-chat/src/MessageInput.tsx @@ -29,7 +29,12 @@ export default function MessageInput(props: Props) { }; const keyPressHandler = async (event: KeyboardEvent) => { - if (event.key === 'Enter') { + if ( + event.key === 'Enter' && + !event.altKey && + !event.ctrlKey && + !event.shiftKey + ) { await sendMessage(); } };