fix(product): 修復條碼掃描自動送出問題並優化手動輸入體驗
This commit is contained in:
@@ -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" : ""}`}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user