Skip to content

Commit 1b67e22

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: Added tip for files input rendering
2 parents 24211d8 + 75194ae commit 1b67e22

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

form/bootstrap4.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ Checkboxes and Radios
9494
For a checkbox/radio field, calling ``form_label()`` doesn't render anything.
9595
Due to Bootstrap internals, the label is already rendered by ``form_widget()``.
9696

97+
File inputs
98+
-----------
99+
100+
File inputs are rendered using the Bootstrap "custom-file" class, which hides
101+
the name of the selected file. To fix that, use the `bs-custom-file-input`_
102+
JavaScript plugin, as recommended by `Bootstrap Forms documentation`_.
103+
97104
Accessibility
98105
-------------
99106

@@ -122,6 +129,8 @@ Symfony Form ``RadioType`` and ``CheckboxType`` by adding some classes to the la
122129
{{ form_row(form.myCheckbox, {label_attr: {class: 'switch-custom'} }) }}
123130
124131
.. _`WCAG 2.0 standard`: https://www.w3.org/TR/WCAG20/
132+
.. _`bs-custom-file-input`: https://www.npmjs.com/package/bs-custom-file-input
133+
.. _`Bootstrap Forms documentation`: https://getbootstrap.com/docs/4.4/components/forms/#file-browser
125134
.. _`custom forms`: https://getbootstrap.com/docs/4.4/components/forms/#custom-forms
126135
.. _`custom radio`: https://getbootstrap.com/docs/4.4/components/forms/#radios
127136
.. _`custom checkbox`: https://getbootstrap.com/docs/4.4/components/forms/#checkboxes

0 commit comments

Comments
 (0)