@@ -43,9 +43,6 @@ class TextArea(ChakraComponent):
4343 # "outline" | "filled" | "flushed" | "unstyled"
4444 variant : Var [str ]
4545
46- # Time in milliseconds to wait between end of input and triggering on_change
47- debounce_timeout : Var [int ]
48-
4946 def get_controlled_triggers (self ) -> Dict [str , Var ]:
5047 """Get the event triggers that pass the component's value to the handler.
5148
@@ -71,11 +68,13 @@ def create(cls, *children, **props) -> Component:
7168 Returns:
7269 The component.
7370 """
74- if isinstance (props .get ("value" ), Var ) and props .get ("on_change" ):
71+ if (
72+ isinstance (props .get ("value" ), Var ) and props .get ("on_change" )
73+ ) or "debounce_timeout" in props :
74+ # Currently default to 50ms, which appears to be a good balance
75+ debounce_timeout = props .pop ("debounce_timeout" , 50 )
7576 # create a debounced input if the user requests full control to avoid typing jank
7677 return DebounceInput .create (
77- super ().create (* children , ** props ),
78- # Currently default to 50ms, which appears to be a good balance
79- debounce_timeout = props .get ("debounce_timeout" , 50 ),
78+ super ().create (* children , ** props ), debounce_timeout = debounce_timeout
8079 )
8180 return super ().create (* children , ** props )
0 commit comments