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

bootstrap_field addon_before_class and addon_after_class feature incomplete #223

Closed
isolationism opened this issue Nov 24, 2021 · 1 comment

Comments

@isolationism
Copy link

Per the bootstrap_field feature documentation, a None value may be supplied to the templatetag to render an input group without wrapping <span> tags:

Set to None to disable the span inside the addon. (for use with buttons)

... But the feature is not implemented. According to the following lines:

addon_before = (
format_html('<span class="input-group-text">{}</span>', self.addon_before) if self.addon_before else ""
)
addon_after = (
format_html('<span class="input-group-text">{}</span>', self.addon_after) if self.addon_after else ""
)

... If either addon_before or addon_after are defined, the wrapper tags and their classes are hard-coded instead of using the values self.addon_before_class and/or self.addon_after_class as defined here:

self.addon_before_class = kwargs.get(
"addon_before_class", self.widget.attrs.pop("addon_before_class", "input-group-text")
)
self.addon_after_class = kwargs.get(
"addon_after_class", self.widget.attrs.pop("addon_after_class", "input-group-text")
)

Since these values are ignored, neither can the classes be changed to another value, nor can they be nullified for the case of rendering a button.

@isolationism
Copy link
Author

Duplicate of #153

isolationism added a commit to weblivion/django-bootstrap5 that referenced this issue Nov 24, 2021
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

1 participant