Repository navigation
fix: let rx.input take the HTML autocomplete string, and turn a bool into "on" or "off" - #7418
Conversation
…into "on" or "off" instead of a value React drops
|
Merging this PR will improve performance by 5.79%
|
| 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)
Footnotes
-
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. ↩
A bool | None var skipped the bool check and failed the Var[str] prop validation, so unwrap the Optional before checking.
Fixes #7417.
TextFieldRoot.auto_completeis nowVar[str], likeelements.Input.auto_completeand the generated stub, sorx.input(auto_complete="off")rendersautoComplete:"off"instead of raising aTypeError.React drops a bool
autoComplete, soTextFieldRoot.createnow maps a bool to"on"or"off", and a bool Var to(var ? "on" : "off"). Existingauto_complete=True/Falsecode keeps working, and now actually sets the attribute. The stub still types the prop asstr, which steers type checkers towards the string form.The stub itself doesn't change. The pyi generator already emitted
elements.Input'sstrtype 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.pycovers strings, bools, a bool Var and a str Var. All 6 cases fail without the change.tests/units/componentspasses (4199 tests), and so do the pre-commit hooks, including pyright.🤖 Generated with Claude Code