Added prices change short cut funtionalies

This commit is contained in:
Srinath 2026-02-09 14:13:40 +05:30
parent 9ae30c81b9
commit 54d90ffa8e
1 changed files with 21 additions and 14 deletions

View File

@ -262,22 +262,29 @@ const StandardTable = () => {
handleEditQuantity(item);
setshortKeyMethod(method);
};
const handleKeyDown = (event) => {
if (!event.ctrlKey) return;
const key = event.key.toLowerCase();
if (key === 'q') {
event.preventDefault();
handleShortcut('qty');
const handleKeyDown = (event) => {
const key = event.key.toLowerCase();
// 👉 ALT + P Open Edit Total Amount
if (event.altKey && key === 'p') {
event.preventDefault();
if (OrderCardDetail?.length > 0) {
OpenEditTotalAmount();
}
return;
}
// 👉 CTRL shortcuts
if (!event.ctrlKey) return;
if (key === 'e') {
event.preventDefault();
handleShortcut('price');
}
};
if (key === 'q') {
event.preventDefault();
handleShortcut('qty');
}
if (key === 'e') {
event.preventDefault();
handleShortcut('price');
}
};
window.addEventListener('keydown', handleKeyDown);