From 2e278ba5ef9ed07d4e525faec0b80271ab0ae6cb Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 3 Aug 2017 10:28:07 -0400 Subject: [PATCH] Fix "Add Field" combo --- modules/ui/field.js | 5 +++++ modules/ui/preset_editor.js | 16 ++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/ui/field.js b/modules/ui/field.js index b9021964d..f763096b8 100644 --- a/modules/ui/field.js +++ b/modules/ui/field.js @@ -151,6 +151,11 @@ export function uiField(context, dispatch, presetField, entity, show) { }; + field.focus = function() { + field.impl.focus(); + }; + + return field; } diff --git a/modules/ui/preset_editor.js b/modules/ui/preset_editor.js index 1899a8d25..4d0735224 100644 --- a/modules/ui/preset_editor.js +++ b/modules/ui/preset_editor.js @@ -161,18 +161,14 @@ export function uiPresetEditor(context) { .container(context.container()) .data(notShown) .minItems(1) - .on('accept', show) + .on('accept', function (d) { + var field = d.field; + field.show = true; + render(selection); + field.focus(); + }) ); - - function show(field) { -//FIXME - // field = field.field; - // field.show = true; - // render(selection); - // field.input.focus(); - } - }