Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add className to element using widgetAttr #3

Open
switchflip opened this issue Mar 26, 2015 · 1 comment
Open

Unable to add className to element using widgetAttr #3

switchflip opened this issue Mar 26, 2015 · 1 comment

Comments

@switchflip
Copy link

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,

@insin
Copy link
Owner

insin commented Mar 26, 2015

This is the danger of pulling UI-specific stuff up to the field layer 😄

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants