We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have implemented a custom MultiWidget input like this:
from django import forms from bootstrap_datepicker_plus.widgets import DatePickerInput, TimePickerInput class PickDateTimeWidget(forms.SplitDateTimeWidget): def __init__(self, attrs=None): widgets = [DatePickerInput, TimePickerInput] forms.MultiWidget.__init__(self, widgets, attrs)
It used to work fine in DBDP 4, but in the latest version (5.0.5), the picker icons are not showing.
It looks like applying the following changes is solving the issue:
diff --git a/src/bootstrap_datepicker_plus/_base.py b/src/bootstrap_datepicker_plus/_base.py index fdf07d1..c33e85f 100644 --- a/src/bootstrap_datepicker_plus/_base.py +++ b/src/bootstrap_datepicker_plus/_base.py @@ -78,7 +78,7 @@ class BasePickerInput(DateTimeBaseInput): """Return widget context dictionary.""" settings = get_widget_settings() context = super().get_context(name, value, attrs) - context["addon_icon_class"] = settings.addon_icon_classes[self.variant] + context["widget"]["addon_icon_class"] = settings.addon_icon_classes[self.variant] return context @deprecated( diff --git a/src/bootstrap_datepicker_plus/templates/bootstrap_datepicker_plus/input.html b/src/bootstrap_datepicker_plus/templates/bootstrap_datepicker_plus/input.html index 23190c4..7ec0455 100644 --- a/src/bootstrap_datepicker_plus/templates/bootstrap_datepicker_plus/input.html +++ b/src/bootstrap_datepicker_plus/templates/bootstrap_datepicker_plus/input.html @@ -1,7 +1,7 @@ <div class="input-group dbdp"> {% include 'django/forms/widgets/text.html' %} <div class="input-group-addon input-group-append input-group-text"> - <i class="{{ addon_icon_class }}"></i> + <i class="{{ widget.addon_icon_class }}"></i> </div> </div> {% if "data-dbdp-debug" in widget.attrs %}
The text was updated successfully, but these errors were encountered:
Fixes monim67#119 - Set the addon_icon_class context on the widget key
9de5a3d
730b824
I have created a pull request for this issue #121 @monim67 @claudep
Sorry, something went wrong.
No branches or pull requests
I have implemented a custom MultiWidget input like this:
It used to work fine in DBDP 4, but in the latest version (5.0.5), the picker icons are not showing.
It looks like applying the following changes is solving the issue:
The text was updated successfully, but these errors were encountered: