mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-13 12:55:05 +02:00
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:
@@ -166,11 +166,12 @@ export function uiEntityEditor(context) {
|
||||
|
||||
// Tag changes that fire on input can all get coalesced into a single
|
||||
// history operation when the user leaves the field. #2342
|
||||
function changeTags(changed, onInput) {
|
||||
// Use explicit entityIDs in case the selection changes before the event is fired.
|
||||
function changeTags(entityIDs, changed, onInput) {
|
||||
|
||||
var actions = [];
|
||||
for (var i in _entityIDs) {
|
||||
var entityID = _entityIDs[i];
|
||||
for (var i in entityIDs) {
|
||||
var entityID = entityIDs[i];
|
||||
var entity = context.entity(entityID);
|
||||
|
||||
var tags = Object.assign({}, entity.tags); // shallow copy
|
||||
|
||||
@@ -100,7 +100,7 @@ export function uiSectionPresetFields(context) {
|
||||
_fieldsArr.forEach(function(field) {
|
||||
field
|
||||
.on('change', function(t, onInput) {
|
||||
dispatch.call('change', field, t, onInput);
|
||||
dispatch.call('change', field, _entityIDs, t, onInput);
|
||||
})
|
||||
.on('revert', function(keys) {
|
||||
dispatch.call('revert', field, keys);
|
||||
|
||||
@@ -553,9 +553,14 @@ export function uiSectionRawTagEditor(id, context) {
|
||||
}
|
||||
|
||||
function scheduleChange() {
|
||||
// Cache IDs in case the editor is reloaded before the change event is called. - #6028
|
||||
var entityIDs = _entityIDs;
|
||||
|
||||
// Delay change in case this change is blurring an edited combo. - #5878
|
||||
window.setTimeout(function() {
|
||||
dispatch.call('change', this, _pendingChange);
|
||||
if (!_pendingChange) return;
|
||||
|
||||
dispatch.call('change', this, entityIDs, _pendingChange);
|
||||
_pendingChange = null;
|
||||
}, 10);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user