Skip to content

Commit 266c584

Browse files
committed
use proper renderer for TelInput widget
1 parent 3820552 commit 266c584

File tree

5 files changed

+9
-1
lines changed

5 files changed

+9
-1
lines changed

assets/tailwind-styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ body {
88
.formset-label {
99
@apply text-sm text-gray-600;
1010
}
11-
.formset-text-input, .formset-email-input, .formset-date-input, .formset-select, .formset-select-multiple, .formset-number-input, .formset-textarea, .formset-password-input, .formset-url-input {
11+
.formset-text-input, .formset-tel-input, .formset-email-input, .formset-date-input, .formset-select, .formset-select-multiple, .formset-number-input, .formset-textarea, .formset-password-input, .formset-url-input {
1212
@apply w-full px-3 py-2 placeholder-gray-300 border border-gray-300 rounded-md focus:outline-none focus:ring focus:ring-indigo-100 focus:border-indigo-300;
1313
}
1414
.formset-dual-selector-select {

formset/renderers/bootstrap.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def _amend_detached_field(self, context):
9393
_context_modifiers = dict(DefaultFormRenderer._context_modifiers, **{
9494
'django/forms/label.html': _amend_label,
9595
'django/forms/widgets/text.html': _amend_input,
96+
'django/forms/widgets/tel.html': _amend_input,
9697
'django/forms/widgets/email.html': _amend_input,
9798
'django/forms/widgets/date.html': _amend_input,
9899
'django/forms/widgets/datetime.html': _amend_input,

formset/renderers/bulma.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def _amend_textarea(self, context):
5555
_context_modifiers = dict(DefaultFormRenderer._context_modifiers, **{
5656
'django/forms/label.html': _amend_label,
5757
'django/forms/widgets/text.html': _amend_input,
58+
'django/forms/widgets/tel.html': _amend_input,
5859
'django/forms/widgets/email.html': _amend_input,
5960
'django/forms/widgets/date.html': _amend_input,
6061
'django/forms/widgets/number.html': _amend_input,

formset/renderers/tailwind.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ def _amend_text_input(self, context):
3030
context['widget']['attrs']['class'] = ClassList('formset-text-input')
3131
return context
3232

33+
def _amend_tel_input(self, context):
34+
context['widget']['attrs']['class'] = ClassList('formset-tel-input')
35+
return context
36+
3337
def _amend_email_input(self, context):
3438
context['widget']['attrs']['class'] = ClassList('formset-email-input')
3539
return context
@@ -119,6 +123,7 @@ def _amend_detached_field(self, context):
119123
_context_modifiers = dict(DefaultFormRenderer._context_modifiers, **{
120124
'django/forms/label.html': _amend_label,
121125
'django/forms/widgets/text.html': _amend_text_input,
126+
'django/forms/widgets/tel.html': _amend_tel_input,
122127
'django/forms/widgets/email.html': _amend_email_input,
123128
'django/forms/widgets/date.html': _amend_date_input,
124129
'django/forms/widgets/number.html': _amend_number_input,

formset/renderers/uikit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def _amend_multiple_input(self, context):
4646
_context_modifiers = dict(DefaultFormRenderer._context_modifiers, **{
4747
'django/forms/label.html': _amend_label,
4848
'django/forms/widgets/text.html': _amend_input,
49+
'django/forms/widgets/tel.html': _amend_input,
4950
'django/forms/widgets/email.html': _amend_input,
5051
'django/forms/widgets/date.html': _amend_input,
5152
'django/forms/widgets/number.html': _amend_input,

0 commit comments

Comments
 (0)