mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 17:52:55 +00:00
Don't leave edit mode on pressing enter if a combobox is active
This commit is contained in:
@@ -159,7 +159,8 @@ iD.ui.preset = function(context) {
|
||||
.call(field.input)
|
||||
.selectAll('input')
|
||||
.on('keydown', function() {
|
||||
if (d3.event.keyCode === 13) { // enter
|
||||
// if user presses enter, and combobox is not active, accept edits..
|
||||
if (d3.event.keyCode === 13 && d3.select('.combobox').empty()) {
|
||||
context.enter(iD.modes.Browse(context));
|
||||
}
|
||||
})
|
||||
|
||||
@@ -154,6 +154,7 @@ d3.combobox = function() {
|
||||
}
|
||||
|
||||
function nav(dir) {
|
||||
if (!suggestions.length) return;
|
||||
idx = Math.max(Math.min(idx + dir, suggestions.length - 1), 0);
|
||||
input.property('value', suggestions[idx].value);
|
||||
render();
|
||||
|
||||
Reference in New Issue
Block a user