Focus only new fields (#1127)

Previous behavior was clearing the name tag whenever something
was selected.
This commit is contained in:
John Firebaugh
2013-03-25 11:50:53 -07:00
parent 70575a0f20
commit 197c453536
+6 -4
View File
@@ -44,7 +44,10 @@ iD.ui.preset = function(context, entity) {
}
function addForm(d) {
draw(formwrap, [d]);
var field = draw(formwrap, [d]);
var input = field.selectAll('input, textarea').node();
if (input) input.focus();
d3.select(this)
.style('opacity', 1)
@@ -113,13 +116,12 @@ iD.ui.preset = function(context, entity) {
keys = keys.concat(field.key ? [field.key] : field.keys);
d3.select(this).call(i);
var input = d3.select(this).selectAll('input, textarea').node();
if (input) input.focus();
});
sections.append('div')
.attr('class', 'tag-help');
return sections;
}
presets.rendered = function() {