From 800b6b5462732038fda63020e1ed94e7de6c2502 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Sat, 10 Aug 2013 10:51:53 -0700 Subject: [PATCH] Set combobox data on update selection A new combobox object is created on every render, while previously the data was set only on the enter selection, leaving it empty in most cases. Fixes #1679 Fixes #1680 --- js/id/ui/preset/combo.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/id/ui/preset/combo.js b/js/id/ui/preset/combo.js index c1ed4cc2c..8507bf1e3 100644 --- a/js/id/ui/preset/combo.js +++ b/js/id/ui/preset/combo.js @@ -10,7 +10,11 @@ iD.ui.preset.combo = function(field) { input.enter().append('input') .attr('type', 'text') - .attr('id', 'preset-input-' + field.id) + .attr('id', 'preset-input-' + field.id); + + input + .on('change', change) + .on('blur', change) .each(function() { if (field.options) { options(field.options); @@ -21,11 +25,7 @@ iD.ui.preset.combo = function(field) { if (!err) options(_.pluck(data, 'value')); }); } - }); - - input - .on('change', change) - .on('blur', change) + }) .call(combobox); function options(opts) {