diff --git a/flinventory_gui/search.py b/flinventory_gui/search.py index 5144a97..697b34f 100644 --- a/flinventory_gui/search.py +++ b/flinventory_gui/search.py @@ -289,11 +289,15 @@ def show_part_changer(ui_element: nicegui.ui.element, part: Part) -> None: continue ui.input( label=level.levelname, - value=location_info.get(level.levelname, "") + value=location_info.get(level.levelname, ""), + autocomplete=level.get_valid_subs() # is not None because of check before ).props( 'autogrow dense' + (' autofocus' if levelname == focus else '') ).on_value_change( lambda event, s=level, ui_ele=location_ui_element: save_location(event, s, ui_ele) + ).tooltip( + ", ".join(level.get_valid_subs(shortcuts='()')) if level.get_valid_subs() + else "Any value is valid. Probably integers are reasonable." ) additional_info = [(key, value) for key, value in location_info.items() if not any(key == schema.levelname for schema in schema_hierachy)]