mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
Fix issue with mobile Safari showing the native selection menu when long-pressing on the map
This commit is contained in:
@@ -2876,6 +2876,12 @@ img.tag-reference-wiki-image {
|
||||
.over-map > * {
|
||||
pointer-events: auto;
|
||||
}
|
||||
/* offscreen this without hiding it */
|
||||
.over-map .select-trap {
|
||||
position: absolute;
|
||||
right: -1000%;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/* Map Controls
|
||||
------------------------------------------------------- */
|
||||
@@ -4064,6 +4070,7 @@ img.tile-debug {
|
||||
background: #000;
|
||||
user-select: none;
|
||||
touch-action: none;
|
||||
-webkit-touch-callout: none;
|
||||
}
|
||||
.main-map * {
|
||||
touch-action: none;
|
||||
|
||||
@@ -163,6 +163,15 @@ export function uiInit(context) {
|
||||
.append('div')
|
||||
.attr('class', 'over-map');
|
||||
|
||||
// HACK: Mobile Safari 14 likes to select anything selectable when long-
|
||||
// pressing, even if it's not targeted. This conflicts with long-pressing
|
||||
// to show the edit menu. We add a selectable offscreen element as the first
|
||||
// child to trick Safari into not showing the selection UI.
|
||||
overMap
|
||||
.append('div')
|
||||
.attr('class', 'select-trap')
|
||||
.text('t');
|
||||
|
||||
overMap
|
||||
.append('div')
|
||||
.attr('class', 'spinner')
|
||||
|
||||
Reference in New Issue
Block a user