Merge pull request 'fix/focus-nav-bug' (#126) from fix/focus-nav-bug into development
Reviewed-on: ADUANASOFT/anexo76#126
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
} from 'lucide-svelte';
|
||||
import { useSidebar } from '$lib/components/ui/sidebar/context.svelte';
|
||||
import { useShortcuts } from '$lib/hooks/use-shortcuts';
|
||||
import { focusStore } from '$lib/stores/focus-store';
|
||||
import { focusStore, interactionMode } from '$lib/stores/focus-store';
|
||||
import { obtenerAtajosPrincipalesEdicionPedimento } from '$lib/config/shortcuts/dashboard/pedimentos/edit';
|
||||
|
||||
// Importar los componentes de cada pestaña (ahora sin botones de guardar propios)
|
||||
@@ -43,13 +43,17 @@
|
||||
import ValidationTabForm from '$lib/components/dashboard/pedimentos/edit/validation-tab-form.svelte';
|
||||
|
||||
// Importar solo la API de pedimentos
|
||||
import { pedimentosApi, type CreatePedimentoData, type UpdatePedimentoData } from '$lib/api/dashboard/a76/pedimentos';
|
||||
import {
|
||||
pedimentosApi,
|
||||
type CreatePedimentoData,
|
||||
type UpdatePedimentoData
|
||||
} from '$lib/api/dashboard/a76/pedimentos';
|
||||
import type { PedimentoCode } from '$lib/api/dashboard/reference_data/pedimento_codes';
|
||||
import type { CustomsSection } from '$lib/api/dashboard/reference_data/customs_sections';
|
||||
import type { CustomsBroker } from '$lib/api/dashboard/a76/customs-brokers';
|
||||
import type { ClientProvider } from '$lib/api/dashboard/a76/clients-providers';
|
||||
import type { CodePedimentoRegimen } from '$lib/api/dashboard/reference_data/code_pedimento_regimens';
|
||||
|
||||
|
||||
// Get sidebar context
|
||||
const sidebar = useSidebar();
|
||||
|
||||
@@ -76,8 +80,9 @@
|
||||
let activeTab = $state('general');
|
||||
|
||||
// Focus first input when switching main tabs (mouse or shortcut)
|
||||
|
||||
$effect(() => {
|
||||
if (activeTab) {
|
||||
if (activeTab && $interactionMode === 'keyboard') {
|
||||
focusStore.request('first-input');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user