Create an Input component. Args: *children: The children of the component. **props: The properties of the component. Returns: The component.
(cls, *children, **props)
| 85 | |
| 86 | @classmethod |
| 87 | def create(cls, *children, **props) -> Component: |
| 88 | """Create an Input component. |
| 89 | |
| 90 | Args: |
| 91 | *children: The children of the component. |
| 92 | **props: The properties of the component. |
| 93 | |
| 94 | Returns: |
| 95 | The component. |
| 96 | """ |
| 97 | if ( |
| 98 | isinstance(props.get("value"), Var) and props.get("on_change") |
| 99 | ) or "debounce_timeout" in props: |
| 100 | # Currently default to 50ms, which appears to be a good balance |
| 101 | debounce_timeout = props.pop("debounce_timeout", 50) |
| 102 | # create a debounced input if the user requests full control to avoid typing jank |
| 103 | return DebounceInput.create( |
| 104 | super().create(*children, **props), debounce_timeout=debounce_timeout |
| 105 | ) |
| 106 | return super().create(*children, **props) |
| 107 | |
| 108 | |
| 109 | class InputGroup(ChakraComponent): |