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

widget attrs #43

Closed
rgildein opened this issue Sep 30, 2018 · 7 comments
Closed

widget attrs #43

rgildein opened this issue Sep 30, 2018 · 7 comments
Assignees

Comments

@rgildein
Copy link

cannot pass widget attrs for modal at bootstrap4

ColorWidget(attrs={'class': 'form-control colorfield_field jscolor {zIndex: 1080}'})

@polrodoreda
Copy link

Same problem here. It will be a great update.

@fabiocaccamo fabiocaccamo self-assigned this Feb 17, 2020
@fabiocaccamo
Copy link
Owner

I just released 0.2.0 version, could you check it please?

@N1K1TAS95
Copy link
Contributor

Hi!
I stil have this issue.
My form is:

from colorfield.widgets import ColorWidget

class CategoryForm(forms.ModelForm):
    class Meta:
        model = Category
        fields = ['name', 'fontawesome_icon', 'color']
        widgets = {'color': ColorWidget(attrs={'class': 'input'})}

and when rendered the resulting input classes are form-control colorfield_field jscolor.

I have colorfield versione 0.7.0 and Django 4.0.4

Thanks 😉.

@fabiocaccamo fabiocaccamo reopened this Jun 7, 2022
@fabiocaccamo
Copy link
Owner

@N1K1TAS95 thank you for reporting this, if in the meantime you fix it, feel free to submit a PR.

@N1K1TAS95
Copy link
Contributor

@fabiocaccamo I've added a PR.
I found that template color.html did not included {{ class }} from context while rendering.

@N1K1TAS95
Copy link
Contributor

@fabiocaccamo
I also think that form-control is for Bootstrap only. Maybe it's the case to remove this defalut class and let user decide it. But it maybe break someones code...

@fabiocaccamo
Copy link
Owner

@N1K1TAS95 thank you for the PR, you can upgrade to 0.7.1 version.

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

No branches or pull requests

4 participants