maxLength has stopped cutting off text?

HI, not sure why, or when, but for some reason one of my text fields has stopped cutting off text. It validates on save, but doesn't actually prevent text from going beyond 16 chars when typing within it, which it used to, any ideas please? I've pasted the code below, which feels silly, but might help! Thanks!
TextInput::make('reference')
->maxLength(16)
->hint('Max 16 characters')
->required(),
TextInput::make('reference')
->maxLength(16)
->hint('Max 16 characters')
->required(),
3 Replies
FranklySteve
FranklySteveOP12mo ago
Hi, any ideas please? 🙂
Blackpig
Blackpig12mo ago
IIRC maxLength is for validation and length will restrict the field size Ah no sorry - just checked the docs - length sepcifies an exact length, my bad
FranklySteve
FranklySteveOP12mo ago
Thanks for trying

Did you find this page helpful?