Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#7,417 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@benedikt-bartscher ci sta già lavorando.

Dal 5/10/2026.

  • #7418 di @benedikt-bartscher — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, react
Ambito
frontend

Direzione di ricerca

Inizia leggendo TextFieldRoot in text_field.py e confronta la sua dichiarazione di auto_complete con quella dell’elemento genitore elements.Input. Controlla i test pertinenti del componente o aggiungi una copertura per rx.input(auto_complete="off"). Il lavoro è completato quando la stringa viene accettata e renderizzata come autoComplete:"off", in linea con il comportamento atteso nell’issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
rx.input (TextFieldRoot) declares auto_complete: Var[bool], but the HTML autocomplete attribute takes a string ("on", "off", or autofill tokens such as "email"). Its parent elements.Input declares auto_complete: Var[str], and so does the generated stub for rx.input. As a result, neither form works:

rx.input(auto_complete=False)  # renders autoComplete:false, which React drops
rx.input(auto_complete="off")  # TypeError: Invalid var passed for prop TextFieldRoot.auto_complete, expected type <class 'bool'>, got value off of type <class 'str'>.

React 19 renders <input autoComplete={false}/> as a bare <input/> and warns "Received false for a non-boolean attribute autoComplete". It does the same for true; only strings reach the DOM. So the prop can't turn browser autocomplete off, and type checkers, which read the stub, accept only the strings that fail at runtime.

To Reproduce

import reflex as rx

rx.input(auto_complete="off")  # TypeError
print(rx.input(auto_complete=False))  # jsx(RadixThemesTextField.Root,{autoComplete:false},)

Expected behavior
rx.input(auto_complete="off") renders autoComplete:"off", like rx.el.input(auto_complete="off") does.

Specifics (please complete the following information):

  • Python Version: 3.14
  • Reflex Version: main (0.9.13.dev, text_field.py unchanged since 0.9.12)
  • OS: Linux
  • Browser (Optional): any; checked with react-dom 19.2.8's renderToStaticMarkup

Additional context
The stub shows str because _extract_class_props_as_ast_nodes in the pyi generator walks the MRO base-first and keeps the first declaration of each prop. A subclass's override of a prop's type or doc therefore never reaches the stub: TextFieldRoot's default_value and max_length also show elements.Input's types. That's a separate bug, so I'm keeping it out of the fix for this one.

Lingua principale
Python
Stelle
28.9k
Fork
1.8k
Merge medio
1g 22h
PR unite (30g)
199

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di reflex-dev/reflex

Tutte le issue di reflex-dev/reflex

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.