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

Cannot use add-ons with Select widgets #613

Open
AdrianRichardson opened this issue May 15, 2024 · 2 comments
Open

Cannot use add-ons with Select widgets #613

AdrianRichardson opened this issue May 15, 2024 · 2 comments

Comments

@AdrianRichardson
Copy link

Because FieldRenderer.is_form_control_widget does not include the Select widget, it is not considered eligible for addons (before or after)

@dyve
Copy link
Member

dyve commented Aug 10, 2024

Can you add example code or a failing test so we know what to fix?

@calebsyring
Copy link

@dyve

Form:

class MREForm(forms.Form):
    input_field = forms.CharField()
    select_field = forms.ChoiceField()

Template:

{% bootstrap_field form.input_field addon_before='<span>foo</span>' %}
{% bootstrap_field form.select_field addon_before='<span>foo</span>' %}

Output:
image

The addon is simply ignored in the case of a select field. It doesn't appear in the html at all.

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

3 participants