Added prices change short cut funtionalies

This commit is contained in:
Srinath 2026-02-09 14:14:41 +05:30
parent b02e2e84f3
commit 7b61ca2da7
1 changed files with 21 additions and 14 deletions

View File

@ -281,22 +281,29 @@ const BSBillingTable4 = () => {
setshortKeyMethod(method);
};
const handleKeyDown = (event) => {
if (!preferenceshortcutkey) return;
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 (tableData?.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);