V9 with Bootstrap 5 - does it have a number form input type?

I’m trying to convert my smallest package designed for v8 to run on v9. I see all number inputs look as ugly as hell and are sized randomly.


I can’t find anything on a ‘number’ input type in the Bootstrap docs. Has it been removed? Or replaced with a range?

A glitch I have with any input field in the form helper is the way additional parameters involving [‘class’ => ‘my_class’] are processed.

In v8, such would extend the classes the form helper already provided. In v9, they can replace the classes already provided. So if you are adding your own class, you could be unintentionally also removing the classes the form helper would have provided.

So you have to do something like [‘class’ => ‘my_class form-control’] to keep the BS5 styling.

Thank you, John! That’s fixed it.


BTW, it that a bug or intentional?

I thought I had created an issue on GitHub, but can’t find it so have now added an issue.

Reply from Andrew on Github. The new behaviour is very intentional.

“One of the main drivers behind this is the fact that the form labels require “form-label” for main control labels, and “form-check-label” for inputs.”

And how does extending the class break that driver? It’s the opposite, if you add your class and forget to include the default ones - that breaks the intention. I don’t understand how that’s an improvement.

Agreed. Personally I would have kept the upward compatible behaviour and made the new behaviour an option. For checkbox labels, there could have been a labelCheckbox method.