mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 01:28:55 +00:00
fix(client): preserve explicit dialog focus and verify accessible controls
Keep the focused search for new places and title fields in explicitly opened dialogs. Assert the native ride badge button and the pointer grip tooltip in the existing tests.
This commit is contained in:
@@ -12,6 +12,7 @@ import { PendingFiles, PlaceImageSection } from './PlaceFormMedia'
|
||||
import { usePlaceImageField } from './usePlaceImageField'
|
||||
import { useToast } from '../shared/Toast'
|
||||
import { Tooltip } from '../shared/Tooltip'
|
||||
import { focusRevealedEditor } from '../shared/dialogFocus'
|
||||
import { Search, RotateCcw, LocateFixed, PencilLine } from 'lucide-react'
|
||||
import { useTranslation } from '../../i18n'
|
||||
import { PlaceContactFields } from './PlaceContactFields'
|
||||
@@ -644,7 +645,7 @@ export default function PlaceFormModal(props: PlaceFormModalProps) {
|
||||
type="text"
|
||||
// A new place starts at the search; an edit or a place brought
|
||||
// in from the map already has what the search would give.
|
||||
data-initial-focus={(!place && !prefillCoords) || undefined}
|
||||
ref={!place && !prefillCoords ? focusRevealedEditor : undefined}
|
||||
value={mapsSearch}
|
||||
onChange={e => { setMapsSearch(e.target.value); S.setEmptySearch(null) }}
|
||||
onKeyDown={handleSearchKeyDown}
|
||||
|
||||
Reference in New Issue
Block a user