diff --git a/apps/fishing-map/features/map/annotations/Annotations.tsx b/apps/fishing-map/features/map/annotations/Annotations.tsx index aa73dee8a7..45d2926b2b 100644 --- a/apps/fishing-map/features/map/annotations/Annotations.tsx +++ b/apps/fishing-map/features/map/annotations/Annotations.tsx @@ -2,6 +2,7 @@ import { useSelector } from 'react-redux' import cx from 'classnames' import { Popup } from 'react-map-gl' import { useTranslation } from 'react-i18next' +import { KeyboardEventHandler } from 'react' import { Button, ColorBar, @@ -43,6 +44,11 @@ const MapAnnotations = () => { }) resetMapAnnotation() } + const handleKeyDown: KeyboardEventHandler = (e) => { + if (e.key === 'Enter') { + onConfirmClick() + } + } return ( { value={mapAnnotation.label} onChange={(e) => setMapAnnotation({ label: e.target.value })} placeholder={t('map.annotationPlaceholder', 'Type something here')} + onKeyDown={handleKeyDown} /> { expanded={mapAnnotations?.length > 0} tooltip={ isAnnotating - ? t('map.annotationsStop', 'Stop annotations') + ? t('map.annotationsStop', 'Stop editing annotations') : t('map.annotationsAdd', 'Add annotation') } onClick={onToggleClick} diff --git a/apps/fishing-map/features/map/controls/RulersControl.tsx b/apps/fishing-map/features/map/controls/RulersControl.tsx index 58b609f4cd..776c23208b 100644 --- a/apps/fishing-map/features/map/controls/RulersControl.tsx +++ b/apps/fishing-map/features/map/controls/RulersControl.tsx @@ -30,7 +30,7 @@ const Rulers = () => { expanded={rulers?.length > 0} tooltip={ rulersEditing - ? t('map.rulersStop', 'Stop measures') + ? t('map.rulersStop', 'Stop editing measures') : t('map.rulers_add', 'Measure distance') } onClick={onToggleClick}