mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 19:33:59 +01:00
disable enter to submit for mobile
This commit is contained in:
parent
5f73a68ce5
commit
5f7b445225
|
@ -342,7 +342,12 @@ const EditView = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
||||||
if (e.key === 'Enter') {
|
const isMobile =
|
||||||
|
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|playbook|silk/i.test(
|
||||||
|
navigator.userAgent
|
||||||
|
);
|
||||||
|
|
||||||
|
if (e.key === 'Enter' && !isMobile) {
|
||||||
const enterToSubmit = useStore.getState().enterToSubmit;
|
const enterToSubmit = useStore.getState().enterToSubmit;
|
||||||
if (sticky) {
|
if (sticky) {
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in a new issue