fix(product): 修復條碼掃描自動送出問題並優化手動輸入體驗
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Has been skipped
Koori-ERP-Deploy-System / deploy-production (push) Successful in 1m1s

This commit is contained in:
2026-02-02 09:06:06 +08:00
parent 0d720f3515
commit bb78a432f5
3 changed files with 126 additions and 116 deletions

View File

@@ -176,6 +176,13 @@ export default function ProductDialog({
id="barcode"
value={data.barcode}
onChange={(e) => setData("barcode", e.target.value)}
onKeyDown={(e) => {
if (e.key === 'Enter') {
e.preventDefault();
// 掃描後自動跳轉到下一個欄位(品牌)
document.getElementById('brand')?.focus();
}
}}
placeholder="輸入條碼或自動生成"
className={`flex-1 ${errors.barcode ? "border-red-500" : ""}`}
/>