Skip to content

Commit

Permalink
Add missing ID to TnaIterableBase
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Aug 20, 2024
1 parent af930cd commit d5cbeb6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/forms/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ExampleForm(FlaskForm):
choices=[("cpp", "C++"), ("py", "Python"), ("text", "Plain Text")],
widget=TnaCheckboxesInput(),
)
day = RadioField(
day_of_week = RadioField(
"Day",
choices=[("mon", "Monday"), ("tue", "Tuesday"), ("wed", "Wednesday")],
validators=[
Expand Down
2 changes: 1 addition & 1 deletion test/forms/test-templates/example-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h1 class="tna-heading-xl">Example form</h1>
'headingLevel': 2
}) }}

{{ form.day(params={
{{ form.day_of_week(params={
'headingLevel': 2
}) }}

Expand Down
2 changes: 2 additions & 0 deletions tna_frontend_jinja/wtforms/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def map_tna_params(self, field, **kwargs):
"""

params = {
"id": field.id,
"name": field.name,
"items": kwargs["items"],
"selected": kwargs["selected"],
Expand Down Expand Up @@ -191,6 +192,7 @@ class TnaCheckboxesInput(TnaIterableBase):

def map_tna_params(self, field, **kwargs):
params = super().map_tna_params(field, **kwargs)

params.setdefault(
"label",
field.label.text,
Expand Down

0 comments on commit d5cbeb6

Please sign in to comment.