mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 13:38:26 +02:00
Fix context "edit" menu on touchscreens
* render labels properly, fixes #9425 * always open the touch-specific edit menu (the contextmenu event is always triggered by the browser on long presses, where we need to make sure that this event doesn't override the `isTouchMenu` property of the edit menu)
This commit is contained in:
@@ -35,6 +35,14 @@ _Breaking developer changes, which may affect downstream projects or sites that
|
||||
[@xxxx]: https://github.com/xxxx
|
||||
-->
|
||||
|
||||
# Unreleased
|
||||
|
||||
#### :bug: Bugfixes
|
||||
* Fix context "edit" menu on touchscreens: render labels properly and always open the touch-specific edit menu ([#9425])
|
||||
|
||||
[#9425]: https://github.com/openstreetmap/iD/issues/9425
|
||||
|
||||
|
||||
# 2.24.0
|
||||
##### 2023-Jan-19
|
||||
|
||||
|
||||
@@ -180,7 +180,14 @@ export function behaviorSelect(context) {
|
||||
}
|
||||
} else {
|
||||
_lastMouseEvent = d3_event;
|
||||
_lastInteractionType = 'rightclick';
|
||||
if (d3_event.pointerType === 'touch' || d3_event.pointerType === 'pen' ||
|
||||
d3_event.mozInputSource && ( // firefox doesn't give a pointerType on contextmenu events
|
||||
d3_event.mozInputSource === MouseEvent.MOZ_SOURCE_TOUCH ||
|
||||
d3_event.mozInputSource === MouseEvent.MOZ_SOURCE_PEN)) {
|
||||
_lastInteractionType = 'touch';
|
||||
} else {
|
||||
_lastInteractionType = 'rightclick';
|
||||
}
|
||||
}
|
||||
|
||||
_showMenu = true;
|
||||
|
||||
@@ -120,8 +120,8 @@ export function uiEditMenu(context) {
|
||||
if (showLabels) {
|
||||
buttonsEnter.append('span')
|
||||
.attr('class', 'label')
|
||||
.html(function(d) {
|
||||
return d.title;
|
||||
.each(function(d) {
|
||||
d3_select(this).call(d.title);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user