mirror of
https://github.com/m1ngsama/chat-bubbles-for-yt.git
synced 2025-12-24 10:51:21 +00:00
fix(bubble-input): ignore enter key when composing
This commit is contained in:
parent
fa4a783698
commit
bddf2257fe
1 changed files with 2 additions and 1 deletions
|
|
@ -6,7 +6,8 @@ const BubbleInput = ({ onChange, onSubmit, value }) => {
|
||||||
const [submitted, setSubmitted] = useState(false)
|
const [submitted, setSubmitted] = useState(false)
|
||||||
|
|
||||||
const handleKeyDown = e => {
|
const handleKeyDown = e => {
|
||||||
if (e.key === 'Enter') {
|
const { isComposing } = e.nativeEvent
|
||||||
|
if (e.key === 'Enter' && !isComposing) {
|
||||||
onSubmit && onSubmit()
|
onSubmit && onSubmit()
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
setSubmitted(true)
|
setSubmitted(true)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue