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

RadioField and CheckboxesField giving custom widget{attrs} not only to intself but also to every child #162

Open
yarickprih opened this issue Dec 2, 2020 · 1 comment
Labels

Comments

@yarickprih
Copy link

If you override RadioField's or CheckboxesField's widget attrs and give it a class, the class appears not only in a parent element but also in every child.

<ul id="id_select-multiple" class="checkbox-fields">
    <li><label for="id_select-multiple_0"><input type="checkbox" name="select-multiple" value="Option 1"
                class="checkbox-fields" id="id_select-multiple_0">
            Option 1</label>
    </li>
    <li><label for="id_select-multiple_1"><input type="checkbox" name="select-multiple" value="Option 2"
                class="checkbox-fields" id="id_select-multiple_1">
            Option 2</label>
</ul>

In this case, i gave a CheckboxesField "checkbox-fields" class attr and it appears in parent ul tag and in every child input tag

@nicksce
Copy link

nicksce commented Dec 3, 2020

I think you can use child combinator selector - > in css for styling until the bug is not fixed.

@nnist nnist added the bug label Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants