mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-05 14:38:05 +02:00
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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user