Skip to content

fix: let rx.input take the HTML autocomplete string, and turn a bool into "on" or "off" - #7418

Merged
masenf merged 8 commits into
reflex-dev:mainfrom
benedikt-bartscher:fix/text-field-auto-complete
Oct 12, 2026
Merged

masenf merged 8 commits into
reflex-dev:mainfrom
benedikt-bartscher:fix/text-field-auto-complete

Conversation

@benedikt-bartscher

@benedikt-bartscher benedikt-bartscher commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #7417.

TextFieldRoot.auto_complete is now Var[str], like elements.Input.auto_complete and the generated stub, so rx.input(auto_complete="off") renders autoComplete:"off" instead of raising a TypeError.

React drops a bool autoComplete, so TextFieldRoot.create now maps a bool to "on" or "off", and a bool Var to (var ? "on" : "off"). Existing auto_complete=True/False code keeps working, and now actually sets the attribute. The stub still types the prop as str, which steers type checkers towards the string form.

The stub itself doesn't change. The pyi generator already emitted elements.Input's str type and doc for this prop; that generator bug is described in the issue and left for a separate fix.

Testing:

  • tests/units/components/radix/test_text_field.py covers strings, bools, a bool Var and a str Var. All 6 cases fail without the change.
  • tests/units/components passes (4199 tests), and so do the pre-commit hooks, including pyright.

🤖 Generated with Claude Code

Review in cubic

…into "on" or "off" instead of a value React drops
@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issue was found.

Summary

The PR lets rx.input accept HTML autocomplete strings and converts boolean autocomplete values to "on" or "off". It adds coverage for literal and variable values and a bugfix note.

Reviews (8) · Last reviewed commit: "Merge branch 'main' into fix/text-field-..." · Reviewed by Greptile

@codspeed

codspeed Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 5.79%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 149 untouched benchmarks
⏩ 18 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ test_hydration_metadata[20] 220.5 µs 208.5 µs +5.79%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing benedikt-bartscher:fix/text-field-auto-complete (25567ae) with main (deea1c3)

Open in CodSpeed

Footnotes

  1. 18 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@masenf masenf added the bug Something isn't working label Oct 6, 2026
@benedikt-bartscher
benedikt-bartscher marked this pull request as ready for review October 8, 2026 19:30
@benedikt-bartscher
benedikt-bartscher requested a review from a team as a code owner October 8, 2026 19:30

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

View guided diff | Re-trigger cubic

A bool | None var skipped the bool check and failed the Var[str] prop
validation, so unwrap the Optional before checking.
@masenf masenf added the on deck PRs lined up to review / merge next label Oct 9, 2026 — with ChatGPT Codex Connector
@masenf
masenf merged commit 0df163d into reflex-dev:main Oct 12, 2026
149 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working on deck PRs lined up to review / merge next

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rx.input(auto_complete=...): a bool is dropped by React, and a string raises a TypeError

3 participants