diff --git a/js/id/ui/preset/input.js b/js/id/ui/preset/input.js index 0f35fc117..d9b62f1d0 100644 --- a/js/id/ui/preset/input.js +++ b/js/id/ui/preset/input.js @@ -20,13 +20,6 @@ iD.ui.preset.url = function(field) { .on('blur', change) .on('change', change); - function pm(elem, x) { - var num = elem.value ? - parseInt(elem.value, 10) : 0; - if (!isNaN(num)) elem.value = num + x; - change(); - } - if (field.type == 'number') { input.attr('type', 'text'); @@ -46,7 +39,10 @@ iD.ui.preset.url = function(field) { spinControl.selectAll('button') .on('click', function(d) { - pm(input.node(), d); + d3.event.preventDefault(); + var num = parseInt(input.node().value || 0, 10); + if (!isNaN(num)) input.node().value = num + d; + change(); }); } } diff --git a/js/id/ui/preset/localized.js b/js/id/ui/preset/localized.js index f356aca2a..9957455d6 100644 --- a/js/id/ui/preset/localized.js +++ b/js/id/ui/preset/localized.js @@ -131,6 +131,7 @@ iD.ui.preset.localized = function(field, context) { wrap.append('button') .attr('class', 'minor button-input-action remove') .on('click', function(d) { + d3.event.preventDefault(); var t = {}; t[key(d.lang)] = undefined; event.change(t);