浏览代码

Revert "Update input.py"

This reverts commit 7af6852d8d851b53a0aa3ae2bd6985b751435eff.
Jacopo 2 年之前
父节点
当前提交
a82d2a6ebc
共有 1 个文件被更改,包括 0 次插入16 次删除
  1. 0 16
      nicegui/elements/input.py

+ 0 - 16
nicegui/elements/input.py

@@ -14,7 +14,6 @@ class Input(ValueElement):
                  password: bool = False,
                  password_toggle_button: bool = False,
                  on_change: Optional[Callable] = None,
-                 autocomplete: list,
                  validation: Dict[str, Callable] = {}) -> None:
         """Text Input
 
@@ -33,7 +32,6 @@ class Input(ValueElement):
         :param password: whether to hide the input (default: False)
         :param password_toggle_button: whether to show a button to toggle the password visibility (default: False)
         :param on_change: callback to execute when the input is confirmed by leaving the focus
-        :param autocomplete: list of options
         :param validation: dictionary of validation rules, e.g. ``{'Too short!': lambda value: len(value) < 3}``
         """
         super().__init__(tag='q-input', value=value, on_value_change=on_change)
@@ -53,20 +51,6 @@ class Input(ValueElement):
 
         self.validation = validation
 
-        if autocomplete is not None:
-            def AutoCompleteInput():
-                global wordcomplete
-                if len(self.value) > 1:
-                    for item in autocomplete:
-                        if item.startswith(self.value):
-                            self.props(f'shadow-text="{item[len(self.value):]}"')
-                            wordcomplete = item
-                else:
-                    self.props(f'shadow-text=" "')
-
-            self.on("keyup", AutoCompleteInput)
-            self.on("keydown.tab", lambda: self.set_value(wordcomplete))
-
     def on_value_change(self, value: Any) -> None:
         super().on_value_change(value)
         for message, check in self.validation.items():