Fix responsiveness issue when selecting features on iPad

Implement an alternative solution for #6028 that doesn't rely on timeouts
This commit is contained in:
Quincy Morgan
2020-03-04 13:10:15 -08:00
parent c41e0b9937
commit 83d2656bbc
4 changed files with 13 additions and 14 deletions
+2 -9
View File
@@ -109,17 +109,10 @@ export function behaviorSelect(context) {
_p1 = null;
if (dist > tolerance) return;
// Defer processing the click,
// because this click may trigger a blur event,
// and the blur event may trigger a tag change,
// and we really want that tag change to go to the already selected entity
// and not the one that we are about to select with the click #6028, #5878
// (Be very careful entering modeSelect anywhere that might also blur a field!)
var datum = d3_event.target.__data__ || (_lastMouse && _lastMouse.target.__data__);
var isMultiselect = d3_event.shiftKey || d3_select('#surface .lasso').node();
window.setTimeout(function() {
processClick(datum, isMultiselect);
}, 20); // delay > whatever raw_tag_editor.js `scheduleChange` does (10ms).
processClick(datum, isMultiselect);
}