daggerheart/module/applications/dialogs
George Brocklehurst 615df65415
Fix ctrl+clicking on a downtime action on macOS (#378)
* Refactor: handle button data attrs the same.

A small refactor to handle `button.dataset.move` (which was assigned to a
local const) and `button.dataset.category` (which was accessed directly)
in the same way by assigning them both to local consts.

* Fix right-click on downtime activities on macOS.

On macOS with a single-button mouse (e.g. a laptop trackpad) it's common to
trigger a right-click with ctrl+click.

In Chrome, this triggers both a `contextmenu` event and a regular `click`
event. In the context of downtime actions, this meant that we were
deselecting an action in the `contextmenu` handler but then immediately
re-selecting it again in the `click` handler.

This commit works around the problem by stopping the event from propagating
further. This fixes the bug, but also stops Foundry's default `contextmenu`
handler from firing and preventing the browser context menu from appearing,
so we also have prevent the event's default behaviour from firing.
2025-07-19 19:04:28 +02:00
..
_module.mjs [Feature] Item Resource Support (#328) 2025-07-13 20:12:32 -03:00
beastformDialog.mjs Language Organization (#281) 2025-07-06 17:43:12 +02:00
costSelectionDialog.mjs fix style problems in bottom sheets and enhance damage and action dialogs (#325) 2025-07-12 14:44:14 +02:00
d20RollDialog.mjs Feature/344 bardic rally (#363) 2025-07-17 00:45:53 +02:00
damageDialog.mjs Feature/336 damage targeted resources (#376) 2025-07-19 15:48:50 +02:00
damageReductionDialog.mjs Feature/336 damage targeted resources (#376) 2025-07-19 15:48:50 +02:00
damageSelectionDialog.mjs fix style problems in bottom sheets and enhance damage and action dialogs (#325) 2025-07-12 14:44:14 +02:00
deathMove.mjs Language Organization (#281) 2025-07-06 17:43:12 +02:00
downtime.mjs Fix ctrl+clicking on a downtime action on macOS (#378) 2025-07-19 19:04:28 +02:00
ownershipSelection.mjs Language Organization (#281) 2025-07-06 17:43:12 +02:00
resourceDiceDialog.mjs Improved the datastructure some to avoid errors and simplify useage (#361) 2025-07-17 14:07:11 -03:00