Skip to content

Commit f136435

Browse files
authored
Merge pull request #7 from LaunchPlatform/fix-6-render-kw-ignored-issue
Fix #6 render_kw ignored issue
2 parents 78c95ae + 28d16b9 commit f136435

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tests/test_renderer.py

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ def test_render(
4848
# Notice: lxml parser will add html and body automatically in the tree
4949
assert tree.xpath("/html/body/form")
5050
assert tree.xpath('/html/body/form/div[@class="mb-3"]/input[@name="email"]')
51+
assert tree.xpath(
52+
'/html/body/form/div[@class="mb-3"]/input[@name="email"]/@placeholder'
53+
) == ["Foobar"]
5154
assert tree.xpath('/html/body/form/div[@class="mb-3"]/input[@name="password"]')
5255
assert tree.xpath('/html/body/form/div[@class="mb-3"]/select[@name="city"]')
5356
assert tree.xpath(

wtforms_bootstrap5/renderers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def render_field(context: RendererContext, element: FormElement) -> Markup:
9999
field_kwargs["class"] = " ".join(field_classes)
100100
field_kwargs.update(field_options.field_attrs)
101101

102-
field_content = [field.widget(field, **field_kwargs)]
102+
field_content = [field(**field_kwargs)]
103103
if field.description:
104104
help_message = escape(field.description)
105105
field_content.append(

0 commit comments

Comments
 (0)