From e8ceba1107ff13784ae2f286571f9add95d29411 Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Fri, 14 Oct 2022 12:56:54 +0200 Subject: [PATCH] only use long-press context menu behavior on touch/stylus inputs closes #8105 --- CHANGELOG.md | 3 +++ modules/behavior/select.js | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a87f276f2..41bd4a55e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,8 @@ _Breaking developer changes, which may affect downstream projects or sites that #### :newspaper: News #### :tada: New Features +#### :sparkles: Usability & Accessibility +* Trigger context menu by long-presses of non-mouse inputs (touch or stylus) ([#8105]) #### :white_check_mark: Validation #### :bug: Bugfixes * Fix selection of best background source when starting on a zoomed-out view ([#9325]) @@ -49,6 +51,7 @@ _Breaking developer changes, which may affect downstream projects or sites that #### :hammer: Development * Synchronize fetching of released presets +[#8105]: https://github.com/openstreetmap/iD/issues/8105 [#9294]: https://github.com/openstreetmap/iD/issues/9294 [#9320]: https://github.com/openstreetmap/iD/pull/9320 [#9325]: https://github.com/openstreetmap/iD/issues/9325 diff --git a/modules/behavior/select.js b/modules/behavior/select.js index 17d4ee0f9..ee5e02e4d 100644 --- a/modules/behavior/select.js +++ b/modules/behavior/select.js @@ -97,7 +97,9 @@ export function behaviorSelect(context) { context.ui().closeEditMenu(); - _longPressTimeout = window.setTimeout(didLongPress, 500, id, 'longdown-' + (d3_event.pointerType || 'mouse')); + if (d3_event.pointerType !== 'mouse') { + _longPressTimeout = window.setTimeout(didLongPress, 500, id, 'longdown-' + (d3_event.pointerType || 'mouse')); + } _downPointers[id] = { firstEvent: d3_event,