Skip to content

Commit

Permalink
SelectWidget needs SelectFieldBase
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Dec 19, 2023
1 parent fa8d8e2 commit b3d57d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/baseframe/forms/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from flask import current_app, render_template
from furl import furl
from markupsafe import Markup, escape
from wtforms import Field as WTField
from wtforms import Field as WTField, SelectFieldBase
from wtforms.widgets import RadioInput, Select, html_params

from ..extensions import _
Expand All @@ -31,7 +31,7 @@
class SelectWidget(Select):
"""Add support of choices with ``optgroup`` to the ``Select`` widget."""

def __call__(self, field: WTField, **kwargs: t.Any) -> Markup:
def __call__(self, field: SelectFieldBase, **kwargs: t.Any) -> Markup:
kwargs.setdefault('id', field.id)
if self.multiple:
kwargs['multiple'] = True
Expand Down Expand Up @@ -61,7 +61,7 @@ def __call__(self, field: WTField, **kwargs: t.Any) -> Markup:
class Select2Widget(Select):
"""Add a select2 class to the rendered select widget."""

def __call__(self, field: WTField, **kwargs: t.Any) -> Markup:
def __call__(self, field: SelectFieldBase, **kwargs: t.Any) -> Markup:
kwargs.setdefault('id', field.id)
kwargs.pop('type', field.type)
if field.multiple:
Expand Down

0 comments on commit b3d57d2

Please sign in to comment.