From 7dd1c06f3fab408a435829d94898dc5b2330e3bb Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 3 May 2024 19:29:10 +0200 Subject: [PATCH] chore: accessibility of filters --- src/components/JournalView/JournalOptions.vue | 2 +- .../StationsView/StationFilterCard.vue | 22 +- src/components/StationsView/StationTable.vue | 543 +++++++++--------- src/components/TrainsView/TrainOptions.vue | 2 +- 4 files changed, 281 insertions(+), 288 deletions(-) diff --git a/src/components/JournalView/JournalOptions.vue b/src/components/JournalView/JournalOptions.vue index 8b7d023..d427a21 100644 --- a/src/components/JournalView/JournalOptions.vue +++ b/src/components/JournalView/JournalOptions.vue @@ -9,7 +9,7 @@ ref="button" > Open filters - {{ $t('options.filters') }} [F] + [F] {{ $t('options.filters') }} diff --git a/src/components/StationsView/StationFilterCard.vue b/src/components/StationsView/StationFilterCard.vue index 782e47c..46ebe58 100644 --- a/src/components/StationsView/StationFilterCard.vue +++ b/src/components/StationsView/StationFilterCard.vue @@ -3,7 +3,7 @@
@@ -28,8 +28,8 @@
-
-
+
+
{{ $t('filters.title') }}

@@ -137,7 +137,7 @@ :disabled="filterStore.areFiltersAtDefault" :data-disabled="filterStore.areFiltersAtDefault" > - {{ $t('filters.reset') }} + [R] {{ $t('filters.reset') }}
@@ -171,7 +171,10 @@ export default defineComponent({ currentRegion: { id: '', value: '' }, delayInputTimer: -1, - chosenSearchScenery: '' + chosenSearchScenery: '', + + scrollTop: 0, + lastFocusedEl: null as HTMLElement | null }), setup() { @@ -237,7 +240,10 @@ export default defineComponent({ isVisible(value: boolean) { this.$nextTick(() => { - if (value) (this.$refs['cardEl'] as HTMLDivElement).focus(); + if (value) { + (this.$refs['cardRef'] as HTMLDivElement).focus(); + (this.$refs['cardContentRef'] as HTMLDivElement).scrollTop = this.scrollTop; + } }); } }, @@ -248,6 +254,10 @@ export default defineComponent({ this.isVisible = !this.isVisible; }, + onScroll(e: Event) { + this.scrollTop = (e.target as HTMLElement).scrollTop; + }, + handleInput(e: Event) { const target = e.target as HTMLInputElement; diff --git a/src/components/StationsView/StationTable.vue b/src/components/StationsView/StationTable.vue index 3d141d3..f283a10 100644 --- a/src/components/StationsView/StationTable.vue +++ b/src/components/StationsView/StationTable.vue @@ -1,301 +1,295 @@ @@ -395,20 +389,9 @@ export default defineComponent({ $rowCol: #424242; -.change-anim { - &-enter-active, - &-leave-active { - transition: opacity 100ms ease-in; - } - - &-enter, - &-leave-to { - opacity: 0; - } -} - .table_wrapper { overflow: auto; + overflow-y: scroll; font-weight: 500; height: 90vh; min-height: 550px; diff --git a/src/components/TrainsView/TrainOptions.vue b/src/components/TrainsView/TrainOptions.vue index 721e4f6..5763527 100644 --- a/src/components/TrainsView/TrainOptions.vue +++ b/src/components/TrainsView/TrainOptions.vue @@ -4,7 +4,7 @@