[RELEASE] 正式發布:機台管理 UI 選單修正
1. [FIX] 修正機台管理下拉選單遮擋問題,導入 focus-within:z-index 動態層級模式
This commit is contained in:
commit
cbc477d95a
@ -386,6 +386,12 @@ description: 定義 Star Cloud 管理後台的「極簡奢華風」設計規範
|
||||
:selected="request('company_id')"
|
||||
:placeholder="__('All Companies')"
|
||||
/>
|
||||
|
||||
{{-- 下拉選單遮擋處理範例 --}}
|
||||
<div class="relative focus-within:z-20">
|
||||
<label>...</label>
|
||||
<x-searchable-select ... />
|
||||
</div>
|
||||
```
|
||||
|
||||
---
|
||||
@ -435,4 +441,35 @@ async fetchPage(url) {
|
||||
| 基本資訊 | 翠綠 Emerald | `bg-emerald-500/10 text-emerald-500` |
|
||||
| 硬體/插槽 | 琥珀 Amber | `bg-amber-500/10 text-amber-500` |
|
||||
| 系統/進階 | 靛藍 Indigo | `bg-indigo-500/10 text-indigo-500` |
|
||||
| 危險/刪除 | 玫瑰 Rose | `bg-rose-500/10 text-rose-500` |
|
||||
| 危險/刪除 | 玫瑰 Rose | `bg-rose-500/10 text-rose-500` |
|
||||
---
|
||||
|
||||
## 10. Z-Index 堆疊與遮擋處理 (Z-Index Stacking)
|
||||
|
||||
> [!IMPORTANT]
|
||||
> 當頁面或 Modal 中存在多個垂直排列的 x-searchable-select 時,為防止選單開展時被下一個欄位遮擋,嚴禁使用固定的 z-index。
|
||||
|
||||
### 10.1 動態層級提升模式
|
||||
必須在欄位容器上使用 focus-within:z-[index],確保正在操作的欄位永遠處於堆疊最前方。
|
||||
|
||||
| 使用場景 | 推薦 Class |
|
||||
|---------|------------|
|
||||
| 一般表單頁面 | relative focus-within:z-[20] |
|
||||
| 模態框 (Modal) 內 | relative focus-within:z-[60] |
|
||||
|
||||
### 10.2 代碼範例
|
||||
```html
|
||||
<div class="space-y-4">
|
||||
<!-- 型號選單 -->
|
||||
<div class="relative focus-within:z-[60]">
|
||||
<label>型號</label>
|
||||
<x-searchable-select ... />
|
||||
</div>
|
||||
|
||||
<!-- 公司選單 -->
|
||||
<div class="relative focus-within:z-[60]">
|
||||
<label>公司</label>
|
||||
<x-searchable-select ... />
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
@ -131,7 +131,7 @@
|
||||
<input type="text" name="location" value="{{ old('location', $machine->location) }}" class="luxury-input w-full" placeholder="{{ __('e.g., Taipei Station') }}">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="relative focus-within:z-[30]">
|
||||
<label class="block text-xs font-bold text-slate-400 uppercase tracking-[0.15em] mb-2">{{ __('Machine Model') }} <span class="text-rose-500">*</span></label>
|
||||
<x-searchable-select
|
||||
name="machine_model_id"
|
||||
@ -143,7 +143,7 @@
|
||||
</x-searchable-select>
|
||||
</div>
|
||||
@if(auth()->user()->isSystemAdmin())
|
||||
<div>
|
||||
<div class="relative focus-within:z-[30]">
|
||||
<label class="block text-xs font-bold text-slate-400 uppercase tracking-[0.15em] mb-2">{{ __('Company') }}</label>
|
||||
<x-searchable-select
|
||||
name="company_id"
|
||||
|
||||
@ -770,7 +770,7 @@
|
||||
placeholder="{{ __('Enter machine location') }}">
|
||||
</div>
|
||||
|
||||
<div class="relative z-40">
|
||||
<div class="relative focus-within:z-[60]">
|
||||
<label
|
||||
class="block text-[11px] font-black text-slate-400 uppercase tracking-[0.2em] mb-2">
|
||||
{{ __('Model') }} <span class="text-rose-500">*</span>
|
||||
@ -782,7 +782,7 @@
|
||||
</x-searchable-select>
|
||||
</div>
|
||||
|
||||
<div class="relative z-50">
|
||||
<div class="relative focus-within:z-[60]">
|
||||
<label
|
||||
class="block text-[11px] font-black text-slate-400 uppercase tracking-[0.2em] mb-2">
|
||||
{{ __('Owner') }}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user