Repository navigation
fix: let rx.input take the HTML autocomplete string, and turn a bool into "on" or "off" #7418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
masenf
merged 8 commits into
reflex-dev:main
from
benedikt-bartscher:fix/text-field-auto-complete
Oct 12, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
98a5196
fix: let rx.input take the HTML autocomplete string, and turn a bool …
benedikt-bartscher 5e23589
test: move the text field test to the path mirroring its module below…
benedikt-bartscher d705512
Merge branch 'main' into fix/text-field-auto-complete
benedikt-bartscher 968f5d9
Merge branch 'main' into fix/text-field-auto-complete
benedikt-bartscher 5675851
fix: convert an optional bool auto_complete var to "on" or "off" too
benedikt-bartscher d8f5530
Merge branch 'main' into fix/text-field-auto-complete
benedikt-bartscher 08e5a92
Merge branch 'main' into fix/text-field-auto-complete
benedikt-bartscher 25567ae
Merge branch 'main' into fix/text-field-auto-complete
benedikt-bartscher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
packages/reflex-components-radix/news/+text-field-auto-complete.bugfix.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| `rx.input`'s `auto_complete` now takes the HTML autocomplete value, such as `"off"` or `"email"`, which used to raise a `TypeError`. A bool still works and now becomes `"on"` or `"off"`; before, React dropped it and browser autocomplete stayed on. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
30 changes: 30 additions & 0 deletions
30
tests/units/reflex_components_radix/themes/components/test_text_field.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| from typing import Any | ||
|
|
||
| import pytest | ||
| from reflex_base.vars.base import Var | ||
| from reflex_components_radix.themes.components.text_field import TextFieldRoot | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| ("auto_complete", "expected"), | ||
| [ | ||
| ("off", '"off"'), | ||
| ("email", '"email"'), | ||
| (False, '"off"'), | ||
| (True, '"on"'), | ||
| (Var(_js_expr="enabled", _var_type=bool), '(enabled ? "on" : "off")'), | ||
| (Var(_js_expr="flag", _var_type=bool | None), '(flag ? "on" : "off")'), | ||
| (Var(_js_expr="hint", _var_type=str), "hint"), | ||
| (Var(_js_expr="maybe_hint", _var_type=str | None), "maybe_hint"), | ||
| ], | ||
| ) | ||
| def test_auto_complete_renders_a_string(auto_complete: Any, expected: str): | ||
|
greptile-apps[bot] marked this conversation as resolved.
|
||
| """React drops a bool autoComplete, so a bool becomes "on" or "off". | ||
|
|
||
| Args: | ||
| auto_complete: The auto_complete prop, typed str but still accepting a bool. | ||
| expected: The rendered autoComplete value. | ||
| """ | ||
| text_field = TextFieldRoot.create(auto_complete=auto_complete) | ||
|
|
||
| assert f"autoComplete:{expected}" in str(text_field) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.