From 2dd80ba6cc163b4700a8f84ddc935b39617eeea1 Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Wed, 29 Jan 2025 13:16:54 +0100 Subject: [PATCH] fix focus state for dropdowns, fix taborder for timerange select in timetracker and timeentryrows --- e2e/time.spec.ts | 7 +-- .../Common/Reporting/ReportingFilterBadge.vue | 1 + .../js/packages/ui/src/Input/Dropdown.vue | 8 ++- .../ui/src/Input/TimeRangeSelector.vue | 2 + .../src/TimeEntry/TimeEntryAggregateRow.vue | 2 +- .../src/TimeEntry/TimeEntryRangeSelector.vue | 9 +++- .../TimeEntry/TimeEntryRowDurationInput.vue | 36 +++---------- .../TimeTracker/TimeTrackerRangeSelector.vue | 53 ++++++++++++++----- 8 files changed, 68 insertions(+), 50 deletions(-) diff --git a/e2e/time.spec.ts b/e2e/time.spec.ts index cc6ffb49..14155158 100644 --- a/e2e/time.spec.ts +++ b/e2e/time.spec.ts @@ -191,7 +191,7 @@ test('test that updating a the start of an existing time entry in the overview w 'time_entry_range_selector' ); await timeEntryRangeElement.click(); - await page.getByTestId('time_picker_input').first().fill('1'); + await page.getByTestId('time_entry_range_start').first().fill('1'); await Promise.all([ page.waitForResponse(async (response) => { return ( @@ -204,10 +204,7 @@ test('test that updating a the start of an existing time entry in the overview w (await response.json()).data.end !== null ); }), - page - .getByTestId('time_entry_range_end') - .getByTestId('time_picker_input') - .press('Enter'), + page.getByTestId('time_entry_range_end').press('Enter'), ]); }); diff --git a/resources/js/Components/Common/Reporting/ReportingFilterBadge.vue b/resources/js/Components/Common/Reporting/ReportingFilterBadge.vue index 5ea0ee47..2484e8fb 100644 --- a/resources/js/Components/Common/Reporting/ReportingFilterBadge.vue +++ b/resources/js/Components/Common/Reporting/ReportingFilterBadge.vue @@ -21,6 +21,7 @@ const activeClass = computed(() => { diff --git a/resources/js/packages/ui/src/TimeEntry/TimeEntryAggregateRow.vue b/resources/js/packages/ui/src/TimeEntry/TimeEntryAggregateRow.vue index e4bd5eeb..f982c1d9 100644 --- a/resources/js/packages/ui/src/TimeEntry/TimeEntryAggregateRow.vue +++ b/resources/js/packages/ui/src/TimeEntry/TimeEntryAggregateRow.vue @@ -152,7 +152,7 @@ function onSelectChange(event: Event) {
diff --git a/resources/js/packages/ui/src/TimeEntry/TimeEntryRangeSelector.vue b/resources/js/packages/ui/src/TimeEntry/TimeEntryRangeSelector.vue index 2834e021..c851eff4 100644 --- a/resources/js/packages/ui/src/TimeEntry/TimeEntryRangeSelector.vue +++ b/resources/js/packages/ui/src/TimeEntry/TimeEntryRangeSelector.vue @@ -19,6 +19,11 @@ const emit = defineEmits<{ }>(); const open = ref(false); +const triggerElement = ref(null); +function closeAndFocusButton() { + triggerElement.value?.focus(); + open.value = false; +}