Skip to content

Commit

Permalink
v4.5.1: fix context menu shouldConfirm
Browse files Browse the repository at this point in the history
  • Loading branch information
fergusean committed Jul 3, 2023
1 parent 5adc002 commit 23932c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@signal24/vue-foundation",
"type": "module",
"version": "4.5.0",
"version": "4.5.1",
"description": "Common components, directives, and helpers for Vue 3 apps",
"module": "./dist/vue-foundation.es.js",
"bin": {
Expand Down
5 changes: 2 additions & 3 deletions src/helpers/context-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function showContextMenu(e: MouseEvent, config: ContextMenuConfig) {
}

if (item.shouldConfirm) {
itemEl.addEventListener('click', () => confirmAction(itemEl, item.handler));
itemEl.addEventListener('click', e => confirmAction(e, itemEl, item.handler));
} else {
itemEl.addEventListener('click', () => item.handler());
}
Expand Down Expand Up @@ -85,7 +85,7 @@ export function showContextMenu(e: MouseEvent, config: ContextMenuConfig) {
wrapperEl.remove();
}

function confirmAction(itemEl: HTMLElement, handler: () => void) {
function confirmAction(e: MouseEvent, itemEl: HTMLElement, handler: () => void) {
if (itemEl.classList.contains('pending-confirm')) {
return handler();
}
Expand All @@ -106,4 +106,3 @@ export function showContextMenu(e: MouseEvent, config: ContextMenuConfig) {
}

// TODO: actually de-select text rather than just using CSS to hide its selection
// TODO: confirm isn't working

0 comments on commit 23932c7

Please sign in to comment.