newforms-bootstrap
newforms-bootstrap copied to clipboard
Unable to add className to element using widgetAttr
First off I really enjoying using this library and thanks for making it. I did however come across an issue when trying to add an additional class to form element. using widgetAttr
.
For example:
advancedSettings: ->
upc: CharField widgetAttrs:
placeholder: "Enter Text Here"
className: "test-class"
taxes: ChoiceField({choices: @choices})
modifiers: ChoiceField({choices: @moreChoices})
allowReturns: BooleanField({required: false})
When this renders, the form only has classes from newform-bootstrap and my test-class
is not applied. Any ideas whats happening?
Thank-you,
This is the danger of pulling UI-specific stuff up to the field layer :smile:
BoostrapFIeld
sets a className
when rendering the Widget
, which overrides any className
attrs already on it.
Will look into the best place to make a change to allow both classNames to be used.