|
@@ -57,22 +57,6 @@ class Input(ValueElement, DisableableElement):
|
|
|
self.validation = validation
|
|
|
|
|
|
if autocomplete:
|
|
|
- ui.add_body_html('''
|
|
|
- <style>
|
|
|
- @media (min-width: 768px) {
|
|
|
- input[list]::-webkit-calendar-picker-indicator {
|
|
|
- display: none;
|
|
|
- }
|
|
|
- }
|
|
|
- </style>
|
|
|
- ''')
|
|
|
- options = ""
|
|
|
- for opt in autocomplete:
|
|
|
- options = options + ("<option value='{0}'></option>".format(opt))
|
|
|
- ui.html('''
|
|
|
- <datalist id="ac-list">
|
|
|
- {0}
|
|
|
- </datalist>'''.format(options))
|
|
|
|
|
|
def find_autocompletion() -> Optional[str]:
|
|
|
if self.value:
|
|
@@ -91,9 +75,8 @@ class Input(ValueElement, DisableableElement):
|
|
|
self.props(f'shadow-text=""')
|
|
|
|
|
|
self.on('keyup', autocomplete_input)
|
|
|
- self.on('update:model-value', autocomplete_input) # prevent shadow-text on datalist selected item
|
|
|
- self.on('keydown.enter', complete_input)
|
|
|
- self.props(add='list="ac-list"')
|
|
|
+ self.on('dblclick', complete_input)
|
|
|
+ self.on('keydown.right', complete_input)
|
|
|
|
|
|
def on_value_change(self, value: Any) -> None:
|
|
|
super().on_value_change(value)
|