diff --git a/modules/ui/fields/cycleway.js b/modules/ui/fields/cycleway.js index 5aaf9f4b3..db10edfca 100644 --- a/modules/ui/fields/cycleway.js +++ b/modules/ui/fields/cycleway.js @@ -8,7 +8,7 @@ import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util'; export function uiFieldCycleway(field, context) { var dispatch = d3_dispatch('change'); var items = d3_select(null); - + var wrap = d3_select(null); function cycleway(selection) { @@ -17,7 +17,7 @@ export function uiFieldCycleway(field, context) { } - var wrap = selection.selectAll('.form-field-input-wrap') + wrap = selection.selectAll('.form-field-input-wrap') .data([0]); wrap = wrap.enter() @@ -122,8 +122,8 @@ export function uiFieldCycleway(field, context) { cycleway.focus = function() { - items.selectAll('.preset-input-cycleway') - .node().focus(); + var node = wrap.selectAll('input').node(); + if (node) node.focus(); };