Update frontend components for accessibility and functionality improvements

- Modified docker-compose.dev.yml to conditionally run npm install based on the presence of package-lock.json.
- Upgraded Nuxt version in package-lock.json from 3.21.1 to 4.3.1 for enhanced features.
- Enhanced ConfirmModal component with aria-modal attribute for better accessibility.
- Updated MapErrorBoundary component's error message for clarity.
- Added role and aria-label attributes to MapView and MapSearch components for improved screen reader support.
- Refactored various components to manage focus behavior on modal close, enhancing user experience.
- Improved ToastContainer styling for better responsiveness and visibility.
- Updated layout components to include skip navigation links for improved accessibility.
This commit is contained in:
2026-03-04 01:00:56 +03:00
parent 47b81c8f22
commit adfdfd01c4
22 changed files with 2703 additions and 1140 deletions

View File

@@ -1,7 +1,14 @@
<template>
<dialog ref="modalRef" class="modal" @cancel="$emit('close')">
<dialog
ref="modalRef"
class="modal"
aria-modal="true"
:aria-labelledby="titleId"
@cancel="$emit('close')"
@close="onDialogClose"
>
<div class="modal-box transition-all duration-200" @click.stop>
<h3 class="font-bold text-lg">{{ title }}</h3>
<h3 :id="titleId" class="font-bold text-lg">{{ title }}</h3>
<div class="py-2">
<label class="label py-0"><span>Name</span></label>
<input
@@ -39,14 +46,17 @@ const emit = defineEmits<{
submit: [name: string]
}>()
const titleId = computed(() => `bookmark-modal-title-${Math.random().toString(36).slice(2)}`)
const modalRef = ref<HTMLDialogElement | null>(null)
const inputRef = ref<HTMLInputElement | null>(null)
const localName = ref(props.defaultName)
let previousActiveElement: HTMLElement | null = null
watch(
() => props.open,
(open) => {
if (open) {
previousActiveElement = (import.meta.client ? document.activeElement : null) as HTMLElement | null
localName.value = props.defaultName || ''
nextTick(() => {
modalRef.value?.showModal()
@@ -59,6 +69,12 @@ watch(
{ immediate: true }
)
function onDialogClose() {
if (import.meta.client && previousActiveElement && typeof previousActiveElement.focus === 'function' && document.contains(previousActiveElement)) {
nextTick(() => previousActiveElement?.focus())
}
}
watch(
() => props.defaultName,
(name) => {