{# Search-select fragment — debounced search with dropdown results, Alpine state #} {# ARIA combobox pattern for screen reader accessibility. #} {# Resolve initial value for edit mode: ref objects have display names #} {% set init_id = "" %} {% set init_display = "" %} {% if value is mapping %} {% set init_id = value.get("id", "") %} {% set init_display = value.get("name") or value.get("title") or value.get("label") or value.get("email") or value.get("id", "") %} {% elif value %} {% set init_id = value %} {% set init_display = value %} {% endif %}
{# Hidden input stores the selected value #} {# Visible search input with HTMX debounced search #} {# Loading indicator #} {# Dropdown results container #}
{# Empty state shown before any search #}
Type at least {{ field.source.min_chars }} characters to search...