From 77cfde791371d15389d2a3cbf106e745d759bde3 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Thu, 17 Jan 2019 15:42:35 -0500 Subject: [PATCH] combo, multiCombo, and semiCombo fields now correctly submit the typed value upon pressing enter/return without deselecting the feature (closes #5725) --- modules/ui/fields/combo.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/ui/fields/combo.js b/modules/ui/fields/combo.js index 869c35516..88882084e 100644 --- a/modules/ui/fields/combo.js +++ b/modules/ui/fields/combo.js @@ -323,6 +323,16 @@ export function uiFieldCombo(field, context) { .on('change', change) .on('blur', change); + input + .on('keydown.field', function() { + switch (d3_event.keyCode) { + case 13: // ↩ Return + input.node().blur(); // blurring also enters the value + d3_event.stopPropagation(); + break; + } + }); + if (isMulti || isSemi) { combobox .on('accept', function() {