Limit input size for title and description, and make title wrap

This commit is contained in:
Miroslav Vasilev 2024-01-11 23:28:43 +02:00
parent 446103e952
commit 39ed7d8932
2 changed files with 11 additions and 1 deletions

View file

@ -199,7 +199,7 @@ export default function ExistingEventPage() {
<Typography>You've been invited to...</Typography>
</Grid>
<Grid xs={12}>
<Typography variant="h4">{ event.name }</Typography>
<Typography variant="h4" sx={{ wordBreak: "break-word" }} noWrap={false}>{ event.name }</Typography>
</Grid>
{
(event.description !== null) &&

View file

@ -89,6 +89,11 @@ export default function NewEventPage() {
sx={{ width: "100%" }}
value={event.name}
onChange={(e) => {
if (e.target.value.length > 90) {
e.preventDefault();
return;
}
event.name = e.target.value;
setEvent({...event});
}}
@ -100,6 +105,11 @@ export default function NewEventPage() {
sx={{ width: "100%" }}
value={event.description}
onChange={(e) => {
if (e.target.value.length > 250) {
e.preventDefault();
return;
}
event.description = e.target.value;
setEvent({...event});
}}