diff --git a/modules/modes/add_area.js b/modules/modes/add_area.js index 55b344943..0be3637db 100644 --- a/modules/modes/add_area.js +++ b/modules/modes/add_area.js @@ -15,8 +15,7 @@ export function modeAddArea(context, customMode) { id: 'add-area', button: 'area', title: t('modes.add_area.title'), - description: t('modes.add_area.description'), - key: '3' + description: t('modes.add_area.description') }; var behavior = behaviorAddWay(context) diff --git a/modules/modes/add_line.js b/modules/modes/add_line.js index 82f4578ae..032c96e3b 100644 --- a/modules/modes/add_line.js +++ b/modules/modes/add_line.js @@ -15,8 +15,7 @@ export function modeAddLine(context, customMode) { id: 'add-line', button: 'line', title: t('modes.add_line.title'), - description: t('modes.add_line.description'), - key: '2' + description: t('modes.add_line.description') }; var behavior = behaviorAddWay(context) diff --git a/modules/modes/add_note.js b/modules/modes/add_note.js index 8f7f065a0..c8d1376c4 100644 --- a/modules/modes/add_note.js +++ b/modules/modes/add_note.js @@ -11,7 +11,7 @@ export function modeAddNote(context) { button: 'note', title: t('modes.add_note.title'), description: t('modes.add_note.description'), - key: '4' + key: 'N' }; var behavior = behaviorDraw(context) diff --git a/modules/modes/add_point.js b/modules/modes/add_point.js index c8d98b165..b9dbf7057 100644 --- a/modules/modes/add_point.js +++ b/modules/modes/add_point.js @@ -11,8 +11,7 @@ export function modeAddPoint(context, customMode) { id: 'add-point', button: 'point', title: t('modes.add_point.title'), - description: t('modes.add_point.description'), - key: '1' + description: t('modes.add_point.description') }; var behavior = behaviorDraw(context) diff --git a/modules/ui/search_add.js b/modules/ui/search_add.js index 1674ea7ef..0feb836d0 100644 --- a/modules/ui/search_add.js +++ b/modules/ui/search_add.js @@ -44,6 +44,7 @@ export function uiSearchAdd(context) { .call(utilNoAuto) .on('focus', function() { search.attr('focusing', true); + search.node().setSelectionRange(0, search.property('value').length); popover.classed('hide', false); }) .on('blur', function() { @@ -86,6 +87,12 @@ export function uiSearchAdd(context) { //.call(drawList, context.presets().defaults(geometry, 36)); context.features().on('change.search-add', updateForFeatureHiddenState); + + context.keybinding().on('1', function() { + search.node().focus(); + d3_event.preventDefault(); + d3_event.stopPropagation(); + }); } function drawList(list, presets) { @@ -98,9 +105,9 @@ export function uiSearchAdd(context) { return ['point', 'line', 'area'].indexOf(geometry) !== -1; }).sort(); if (supportedGeometry.length === 1) { - return AddablePresetItem(preset, supportedGeom[0]); + return AddablePresetItem(preset, supportedGeometry[0]); } - return MultiGeometryPresetItem(preset, supportedGeom); + return MultiGeometryPresetItem(preset, supportedGeometry); } });