浏览代码

#276 add note about `.on(keydown.enter)`

Falko Schindler 2 年之前
父节点
当前提交
4a8be60583
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      nicegui/elements/input.py

+ 6 - 0
nicegui/elements/input.py

@@ -15,6 +15,12 @@ class Input(ValueElement):
                  on_change: Optional[Callable] = None) -> None:
         """Text Input
 
+        This element is based on Quasar's `QInput <https://quasar.dev/vue-components/input>`_ component.
+
+        The `on_change` event is called on every keystroke and the value updates accordingly.
+        If you want to wait until the user confirms the input, you can register a custom event callback, e.g.
+        `ui.input(...).on('keydown.enter', ...)` or `ui.input(...).on('blur', ...)`.
+
         :param label: displayed label for the text input
         :param placeholder: text to show if no value is entered
         :param value: the current value of the text input