mirror of
https://github.com/waku-org/js-waku.git
synced 2025-01-23 18:59:08 +00:00
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.
|
- Test: Upgrade nim-waku node to v0.4.
|
||||||
- Waku Light Push upgraded to `2.0.0-beta1`.
|
- Waku Light Push upgraded to `2.0.0-beta1`.
|
||||||
- Examples (web chat): Catch error if chat message decoding fails.
|
- 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
|
## [0.6.0] - 2021-06-09
|
||||||
|
|
||||||
|
@ -29,7 +29,12 @@ export default function MessageInput(props: Props) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const keyPressHandler = async (event: KeyboardEvent<HTMLInputElement>) => {
|
const keyPressHandler = async (event: KeyboardEvent<HTMLInputElement>) => {
|
||||||
if (event.key === 'Enter') {
|
if (
|
||||||
|
event.key === 'Enter' &&
|
||||||
|
!event.altKey &&
|
||||||
|
!event.ctrlKey &&
|
||||||
|
!event.shiftKey
|
||||||
|
) {
|
||||||
await sendMessage();
|
await sendMessage();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user