fix(mobile): resolve filter dropdown width overflow and header wrapping on CI and Consumable list pages
ITAM PT. KMH - CI Pipeline / Lint, Check & Run Test Suite (push) Canceled after 0s

This commit is contained in:
Wahyudin
2026-10-27 15:16:41 +07:00
parent 4d09fe29bd
commit cd6a1e6034
3 changed files with 57 additions and 45 deletions
+22 -16
View File
@@ -81,8 +81,8 @@
</div>
<!-- Filters & Search -->
<div class="mb-4 flex flex-col sm:flex-row sm:items-center sm:justify-between space-y-3 sm:space-y-0">
<form id="searchForm" method="GET" class="relative w-full sm:w-96">
<div class="mb-4 flex flex-col md:flex-row md:items-center md:justify-between gap-3">
<form id="searchForm" method="GET" class="relative w-full md:w-96 min-w-0">
<input type="hidden" name="status" value="{{ status_filter }}">
{% if category_filter %}<input type="hidden" name="category" value="{{ category_filter }}">{% endif %}
{% if condition_filter %}<input type="hidden" name="condition" value="{{ condition_filter }}">{% endif %}
@@ -90,23 +90,29 @@
<svg class="w-5 h-5 text-gray-400 absolute left-3 top-2.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg>
</form>
<div class="flex items-center space-x-2 w-full sm:w-auto">
<select onchange="location = this.value;" class="px-3 py-2 rounded-xl border border-gray-200 text-xs font-semibold focus:outline-none focus:border-kerinci focus:ring-1 focus:ring-kerinci bg-white text-gray-700 shadow-sm">
<option value="?status={{ status_filter }}&q={{ search_query }}{% if condition_filter %}&condition={{ condition_filter }}{% endif %}">Semua Kategori</option>
{% for cat_val, cat_label in categories %}
<option value="?status={{ status_filter }}&category={{ cat_val }}&q={{ search_query }}{% if condition_filter %}&condition={{ condition_filter }}{% endif %}" {% if category_filter == cat_val %}selected{% endif %}>{{ cat_label }}</option>
{% endfor %}
</select>
<div class="flex items-center gap-2 w-full md:w-auto min-w-0">
<div class="grid grid-cols-2 gap-2 flex-1 md:flex-none w-full md:w-auto min-w-0">
<div class="min-w-0">
<select onchange="location = this.value;" class="w-full md:w-48 truncate px-3 py-2 rounded-xl border border-gray-200 text-xs font-semibold focus:outline-none focus:border-kerinci focus:ring-1 focus:ring-kerinci bg-white text-gray-700 shadow-sm cursor-pointer" style="min-width: 0; max-width: 100%;">
<option value="?status={{ status_filter }}&q={{ search_query }}{% if condition_filter %}&condition={{ condition_filter }}{% endif %}">Semua Kategori</option>
{% for cat_val, cat_label in categories %}
<option value="?status={{ status_filter }}&category={{ cat_val }}&q={{ search_query }}{% if condition_filter %}&condition={{ condition_filter }}{% endif %}" {% if category_filter == cat_val %}selected{% endif %}>{{ cat_label }}</option>
{% endfor %}
</select>
</div>
<select onchange="location = this.value;" class="px-3 py-2 rounded-xl border border-gray-200 text-xs font-semibold focus:outline-none focus:border-kerinci focus:ring-1 focus:ring-kerinci bg-white text-gray-700 shadow-sm">
<option value="?status={{ status_filter }}&category={{ category_filter }}&q={{ search_query }}">Semua Kondisi</option>
{% for cond_val, cond_label in condition_choices %}
<option value="?status={{ status_filter }}&category={{ category_filter }}&condition={{ cond_val }}&q={{ search_query }}" {% if condition_filter == cond_val %}selected{% endif %}>{{ cond_label }}</option>
{% endfor %}
</select>
<div class="min-w-0">
<select onchange="location = this.value;" class="w-full md:w-44 truncate px-3 py-2 rounded-xl border border-gray-200 text-xs font-semibold focus:outline-none focus:border-kerinci focus:ring-1 focus:ring-kerinci bg-white text-gray-700 shadow-sm cursor-pointer" style="min-width: 0; max-width: 100%;">
<option value="?status={{ status_filter }}&category={{ category_filter }}&q={{ search_query }}">Semua Kondisi</option>
{% for cond_val, cond_label in condition_choices %}
<option value="?status={{ status_filter }}&category={{ category_filter }}&condition={{ cond_val }}&q={{ search_query }}" {% if condition_filter == cond_val %}selected{% endif %}>{{ cond_label }}</option>
{% endfor %}
</select>
</div>
</div>
{% if search_query or category_filter or condition_filter or status_filter %}
<a href="{% url 'ci_list' %}" class="px-3 py-2 text-xs font-bold text-gray-500 hover:text-red-600 border border-gray-200 hover:border-red-200 rounded-xl bg-white transition-colors shadow-sm" title="Reset Filter">
<a href="{% url 'ci_list' %}" class="px-3 py-2 text-xs font-bold text-gray-500 hover:text-red-600 border border-gray-200 hover:border-red-200 rounded-xl bg-white transition-colors shadow-sm shrink-0 whitespace-nowrap" title="Reset Filter">
Reset
</a>
{% endif %}