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)
This commit is contained in:
Bryan Housel
2016-04-08 23:32:57 -04:00
parent bd57b81192
commit 0759f17e87

View File

@@ -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);