Skip to content

Commit

Permalink
combo, multiCombo, and semiCombo fields now correctly submit the type…
Browse files Browse the repository at this point in the history
…d value upon pressing enter/return without deselecting the feature (closes #5725)
  • Loading branch information
quincylvania committed Jan 17, 2019
1 parent bb4d0a9 commit 77cfde7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/ui/fields/combo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 77cfde7

Please sign in to comment.