F
Filament15mo ago
Vp

numeric minValue still accepting negative value in input field

I am trying to use numeric and minValue like below, but as we can see from the video it still accept negative value. If I set ->minValue(0) then I think I cannot see negative value in input or does my expectation is wrong? My code:
Forms\Components\TextInput::make('vacancies')
->required()
->numeric()
->minValue(0)
->maxValue(1000),
Forms\Components\TextInput::make('vacancies')
->required()
->numeric()
->minValue(0)
->maxValue(1000),
Edit: Validation is working tho, it validate for zero, so what do I need to make input field not accepting negative value?
3 Replies
ZedoX
ZedoX15mo ago
What browser are you using? I just checked on Firefox, Chrome & Safari on MacOS. It doesn't go below 0
Vp
VpOP15mo ago
I use chrome on ubuntu 22.04
ZedoX
ZedoX15mo ago
I think this issue is related to browser/platform, not sure if you can do anything about it.. as you mentioned backend validation still works for these edge cases, so it should be fine?

Did you find this page helpful?