mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
ignorer touch si champs vide
This commit is contained in:
parent
5b41f24404
commit
b1fc8e843b
2 changed files with 5 additions and 5 deletions
|
|
@ -112,7 +112,7 @@ const JoinRoom: React.FC = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleReturnKey = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
const handleReturnKey = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||||
if (e.key === 'Enter') {
|
if (e.key === 'Enter' && username && roomName) {
|
||||||
handleSocket();
|
handleSocket();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@ const Login: React.FC = () => {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleKeyPress = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
const handleReturnKey = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||||
if (e.key === 'Enter') {
|
if (e.key === 'Enter' && email && password) {
|
||||||
login();
|
login();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -55,7 +55,7 @@ const Login: React.FC = () => {
|
||||||
placeholder="Adresse courriel"
|
placeholder="Adresse courriel"
|
||||||
sx={{ marginBottom: '1rem' }}
|
sx={{ marginBottom: '1rem' }}
|
||||||
fullWidth={true}
|
fullWidth={true}
|
||||||
onKeyDown={handleKeyPress} // Add this line as well
|
onKeyDown={handleReturnKey} // Add this line as well
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextField
|
<TextField
|
||||||
|
|
@ -67,7 +67,7 @@ const Login: React.FC = () => {
|
||||||
placeholder="Mot de passe"
|
placeholder="Mot de passe"
|
||||||
sx={{ marginBottom: '1rem' }}
|
sx={{ marginBottom: '1rem' }}
|
||||||
fullWidth={true}
|
fullWidth={true}
|
||||||
onKeyDown={handleKeyPress} // Add this line as well
|
onKeyDown={handleReturnKey} // Add this line as well
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue