From 0759f17e8776abc59020daabd357e7d02ee3210b Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 8 Apr 2016 23:32:57 -0400 Subject: [PATCH] Don't clean fields (trim whitespace) on every input event Fields only really need to be fully cleaned when the user leaves the field (onChange, onBlur) (closes #3045) --- js/id/ui/entity_editor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/id/ui/entity_editor.js b/js/id/ui/entity_editor.js index 77957cd9b..f3b7aa3f5 100644 --- a/js/id/ui/entity_editor.js +++ b/js/id/ui/entity_editor.js @@ -184,8 +184,11 @@ iD.ui.EntityEditor = function(context) { function changeTags(changed, onInput) { var entity = context.entity(id), annotation = t('operations.change_tags.annotation'), - tags = clean(_.extend({}, entity.tags, changed)); + tags = _.extend({}, entity.tags, changed); + if (!onInput) { + tags = clean(tags); + } if (!_.isEqual(entity.tags, tags)) { if (coalesceChanges) { context.overwrite(iD.actions.ChangeTags(id, tags), annotation);