Skip to content

AI spam#929

Closed
mondi04 wants to merge 2 commits into
pallets-eco:mainfrom
mondi04:fix/select-field-disabled-option
Closed

AI spam#929
mondi04 wants to merge 2 commits into
pallets-eco:mainfrom
mondi04:fix/select-field-disabled-option

Conversation

@mondi04

@mondi04 mondi04 commented Jun 6, 2026

Copy link
Copy Markdown

Closes #928

SelectChoice and Choice had no disabled field, making it impossible
to render <option disabled> without workarounds via render_kw.

What this patch does

  • Adds disabled: bool = False to SelectChoice and Choice
  • Propagates disabled through iter_choices() and iter_groups()
  • Select.render_option renders the disabled HTML attribute when set

Usage

SelectField(choices=[
    SelectChoice("a", "Option A"),
    SelectChoice("b", "Option B", disabled=True),
])

Checklist

  • Tests added that fail without the patch
  • All tests pass with pytest

@davidism davidism closed this Jun 6, 2026
@davidism davidism changed the title feat: add disabled support to SelectChoice and Select widget AI spam Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Select Fields should support disabled option out of the box

2 participants