feat(카페24): 옵션 팝업 이름·코드·추가금액 칸에도 키 이동 적용

- 옵션값 이름, 자체 품목코드, 추가금액 칸에서 Enter/아래 화살표는 아래 행, 위 화살표는 위 행으로 이동
- 한글 조합 중에는 이동하지 않음

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 01:03:55 +09:00
parent 1096fd68ab
commit 282ee559e0
3 changed files with 6 additions and 4 deletions
+3 -2
View File
@@ -338,13 +338,14 @@
e.target.value = salePrice(e.target.closest("tr").querySelector('[name="additional_amount"]').value);
});
tbody.addEventListener("keydown", function (e) {
if (!e.target.classList.contains("cf24-sale-price")) return;
// isComposing: 한글 조합 중 Enter 는 글자 확정용이다 — 여기서 옮기면 글자가 깨지거나 두 칸 내려간다.
if (e.isComposing || !e.target.matches('[name="option_text"], [name="custom_variant_code"], [name="additional_amount"], .cf24-sale-price')) return;
var down = e.key === "Enter" || e.key === "ArrowDown";
if (!down && e.key !== "ArrowUp") return;
e.preventDefault();
var tr = e.target.closest("tr")[down ? "nextElementSibling" : "previousElementSibling"];
if (!tr) return;
var next = tr.querySelector(".cf24-sale-price");
var next = tr.cells[e.target.closest("td").cellIndex].querySelector('input[type="text"]');
next.focus();
next.select();
});