forked from CGM_Public/pretix_original
resolve migration TODOs: properly refocus parent on navigations
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, inject, ref, watch, onMounted, onBeforeUnmount } from 'vue'
|
import { computed, inject, ref, watch, onMounted, onBeforeUnmount, nextTick } from 'vue'
|
||||||
import { StoreKey } from '~/sharedStore'
|
import { StoreKey } from '~/sharedStore'
|
||||||
import { STRINGS } from '~/i18n'
|
import { STRINGS } from '~/i18n'
|
||||||
import Category from './Category.vue'
|
import Category from './Category.vue'
|
||||||
@@ -45,7 +45,7 @@ const hiddenParams = computed(() => {
|
|||||||
|
|
||||||
const showVoucherForm = computed(() => store.vouchersExist && !store.disableVouchers && !store.voucherCode)
|
const showVoucherForm = computed(() => store.vouchersExist && !store.disableVouchers && !store.voucherCode)
|
||||||
|
|
||||||
function backToList () {
|
async function backToList () {
|
||||||
store.targetUrl = store.parentStack.pop() || store.targetUrl
|
store.targetUrl = store.parentStack.pop() || store.targetUrl
|
||||||
store.error = null
|
store.error = null
|
||||||
if (!store.subevent) {
|
if (!store.subevent) {
|
||||||
@@ -66,12 +66,10 @@ function backToList () {
|
|||||||
store.view = 'weeks'
|
store.view = 'weeks'
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// wait for redraw, then focus content element for better a11y
|
||||||
// let $el = this.$root.$el
|
const rootEl = form.value?.closest('.pretix-widget-wrapper') as HTMLElement | null
|
||||||
// this.$root.$nextTick(function () {
|
await nextTick()
|
||||||
// // wait for redraw, then focus content element for better a11y
|
rootEl?.focus()
|
||||||
// $el.focus()
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function calcItemsSelected () {
|
function calcItemsSelected () {
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ const store = inject(StoreKey)!
|
|||||||
|
|
||||||
const displayEventInfo = computed(() => store.displayEventInfo || (store.displayEventInfo === null && store.parentStack.length > 0))
|
const displayEventInfo = computed(() => store.displayEventInfo || (store.displayEventInfo === null && store.parentStack.length > 0))
|
||||||
|
|
||||||
function backToCalendar () {
|
async function backToCalendar (event: MouseEvent) {
|
||||||
// TODO
|
|
||||||
// make sure to always focus content element
|
// make sure to always focus content element
|
||||||
// this.$nextTick(function () {
|
await nextTick()
|
||||||
// this.$root.$el.focus()
|
const rootEl = (event.target as HTMLElement).closest('.pretix-widget-wrapper') as HTMLElement | null
|
||||||
// })
|
rootEl?.focus()
|
||||||
|
|
||||||
store.offset = 0
|
store.offset = 0
|
||||||
store.appendEvents = false
|
store.appendEvents = false
|
||||||
|
|
||||||
@@ -37,6 +37,8 @@ function loadMore () {
|
|||||||
store.loading++
|
store.loading++
|
||||||
store.reload()
|
store.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(store)
|
||||||
</script>
|
</script>
|
||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.pretix-widget-event-list
|
.pretix-widget-event-list
|
||||||
|
|||||||
Reference in New Issue
Block a user