Ver código fonte

[REF-1746] Define `value` prop on base rx.el.textarea (#2467)

Masen Furer 1 ano atrás
pai
commit
52d2bccbca

+ 3 - 0
reflex/components/el/elements/forms.py

@@ -413,6 +413,9 @@ class Textarea(BaseHTML):
     # Visible number of lines in the text control
     # Visible number of lines in the text control
     rows: Var[Union[str, int, bool]]
     rows: Var[Union[str, int, bool]]
 
 
+    # The controlled value of the textarea, read only unless used with on_change
+    value: Var[Union[str, int, bool]]
+
     # How the text in the textarea is to be wrapped when submitting the form
     # How the text in the textarea is to be wrapped when submitting the form
     wrap: Var[Union[str, int, bool]]
     wrap: Var[Union[str, int, bool]]
 
 

+ 4 - 0
reflex/components/el/elements/forms.pyi

@@ -2094,6 +2094,9 @@ class Textarea(BaseHTML):
             Union[Var[Union[str, int, bool]], Union[str, int, bool]]
             Union[Var[Union[str, int, bool]], Union[str, int, bool]]
         ] = None,
         ] = None,
         rows: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
         rows: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
+        value: Optional[
+            Union[Var[Union[str, int, bool]], Union[str, int, bool]]
+        ] = None,
         wrap: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
         wrap: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
         access_key: Optional[
         access_key: Optional[
             Union[Var[Union[str, int, bool]], Union[str, int, bool]]
             Union[Var[Union[str, int, bool]], Union[str, int, bool]]
@@ -2217,6 +2220,7 @@ class Textarea(BaseHTML):
             read_only: Indicates whether the textarea is read-only
             read_only: Indicates whether the textarea is read-only
             required: Indicates that the textarea is required
             required: Indicates that the textarea is required
             rows: Visible number of lines in the text control
             rows: Visible number of lines in the text control
+            value: The controlled value of the textarea, read only unless used with on_change
             wrap: How the text in the textarea is to be wrapped when submitting the form
             wrap: How the text in the textarea is to be wrapped when submitting the form
             access_key:  Provides a hint for generating a keyboard shortcut for the current element.
             access_key:  Provides a hint for generating a keyboard shortcut for the current element.
             auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
             auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.

+ 4 - 0
reflex/components/radix/themes/components/textarea.pyi

@@ -167,6 +167,9 @@ class TextArea(CommonMarginProps, RadixThemesComponent, el.Textarea):
             Union[Var[Union[str, int, bool]], Union[str, int, bool]]
             Union[Var[Union[str, int, bool]], Union[str, int, bool]]
         ] = None,
         ] = None,
         rows: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
         rows: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
+        value: Optional[
+            Union[Var[Union[str, int, bool]], Union[str, int, bool]]
+        ] = None,
         wrap: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
         wrap: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
         access_key: Optional[
         access_key: Optional[
             Union[Var[Union[str, int, bool]], Union[str, int, bool]]
             Union[Var[Union[str, int, bool]], Union[str, int, bool]]
@@ -300,6 +303,7 @@ class TextArea(CommonMarginProps, RadixThemesComponent, el.Textarea):
             read_only: Indicates whether the textarea is read-only
             read_only: Indicates whether the textarea is read-only
             required: Indicates that the textarea is required
             required: Indicates that the textarea is required
             rows: Visible number of lines in the text control
             rows: Visible number of lines in the text control
+            value: The controlled value of the textarea, read only unless used with on_change
             wrap: How the text in the textarea is to be wrapped when submitting the form
             wrap: How the text in the textarea is to be wrapped when submitting the form
             access_key:  Provides a hint for generating a keyboard shortcut for the current element.
             access_key:  Provides a hint for generating a keyboard shortcut for the current element.
             auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
             auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.