From c633982b8893f943cc5dff3b3bb79955f5aea41f Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 25 Mar 2013 12:31:02 -0400 Subject: [PATCH] Focus new input fields by default. Fixes #1127 --- js/id/ui/preset.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/id/ui/preset.js b/js/id/ui/preset.js index 20680c56b..73521b140 100644 --- a/js/id/ui/preset.js +++ b/js/id/ui/preset.js @@ -68,7 +68,6 @@ iD.ui.preset = function(context, entity) { return 'preset-field preset-field-' + field.id + ' fillL inspector-inner col12'; }); - var label = sections.append('label') .attr('class', 'form-label') .attr('for', function(field) { return 'preset-input-' + field.id; }) @@ -114,6 +113,9 @@ 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')