F
Filament2y ago
Tim

A question about negative numbers, and Rich Text Editor height

I have two small questions I couldn't figure out.
Forms\Components\TextInput::make('age')->numeric()->minValue(0)
Forms\Components\TextInput::make('age')->numeric()->minValue(0)
When adding numeric() I get the two small arrows in the input field to increase or decrease the number. But when adding minValue(0) users can still go negative with the arrows. It's not a big deal, validation will prevent negative numbers when submitting, but it would be nice if negative numbers can be avoided before that. I know it can be done with num="0" in html, but I'm not sure how to do this with the form builder. The other thing I couldn't find is setting the height for the Rich Text Editor, I would like to add a bit more spacing. Usually you can set rows="xx" on a textarea, I'm looking for something like that. I'm probably just overlooking something, but I couldn't find it. 🙂
8 Replies
johncarter
johncarter2y ago
Theres a extraAttributes method or something similar where you can add html attributes / classes.
awcodes
awcodes2y ago
extraInputAttributes() is what you’re looking for..
Tim
TimOP2y ago
Thanks guys, that was exactly what I was looking for, both issues are fixed now
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dan Harrin
Dan Harrin2y ago
can you hint as to why you would want this? maybe its something we can add to core because i was under the impression that the textarea grows as you type
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dan Harrin
Dan Harrin2y ago
ah ok
Taz416
Taz4167mo ago
@Dan Harrin I ran into this question looking for a way to set the min height on the <p> element gets rendered when the Rich Editor on the form is not present. IE in the view. It has a weird looking height compared to the rest of the disabled form elements.
Want results from more Discord servers?
Add your server