瀏覽代碼

Fix docstring for `validation` in `Input.__init__`

Itay Raveh 2 年之前
父節點
當前提交
70ce9358ae
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      nicegui/elements/input.py

+ 2 - 2
nicegui/elements/input.py

@@ -35,7 +35,7 @@ class Input(ValueElement, DisableableElement):
         :param password_toggle_button: whether to show a button to toggle the password visibility (default: False)
         :param on_change: callback to execute when the value changes
         :param autocomplete: optional list of strings for autocompletion
-        :param validation: dictionary of validation rules, e.g. ``{'Too short!': lambda value: len(value) < 3}``
+        :param validation: dictionary of validation rules, executed in dict order. e.g. ``{'Too long!': lambda value: len(value) < 3}``
         """
         super().__init__(tag='q-input', value=value, on_value_change=on_change)
         if label is not None:
@@ -71,7 +71,7 @@ class Input(ValueElement, DisableableElement):
                 match = find_autocompletion()
                 if match:
                     self.set_value(match)
-                self.props(f'shadow-text=""')
+                self.props('shadow-text=""')
 
             self.on('keyup', autocomplete_input)
             self.on('keydown.tab', complete_input)