Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #6469 from Foo-x/6400-focus-charts-and-tables
Browse files Browse the repository at this point in the history
fix: focus to charts and tables
  • Loading branch information
soutaito authored Jun 24, 2021
2 parents 214828d + 70d08df commit f3817be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions components/index/_shared/DataViewTable.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<v-data-table
:ref="'displayedTable'"
:headers="headers"
:items="items"
:items-per-page="-1"
Expand Down Expand Up @@ -84,6 +85,16 @@ const options: ThisTypedComponentOptionsWithRecordProps<
.filter((h) => h !== this.headerKey)
},
},
mounted() {
const vTables = this.$refs.displayedTable as Vue
const vTableElement = vTables.$el
const tables = vTableElement.querySelectorAll('table')
// NodeListをIE11でforEachするためのワークアラウンド
const nodes = Array.prototype.slice.call(tables, 0)
nodes.forEach((table: HTMLElement) => {
table.setAttribute('tabindex', '0')
})
},
methods: {
formatDate(dateString: string): string {
const date = dayjs(new Date(dateString))
Expand Down
2 changes: 1 addition & 1 deletion components/index/_shared/ScrollableChart.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div ref="chartContainer" class="LegendStickyChart">
<div ref="scrollable" class="scrollable">
<div ref="scrollable" class="scrollable" tabindex="0">
<div :style="{ width: `${chartWidth}px` }">
<slot name="chart" :chart-width="chartWidth" />
</div>
Expand Down

0 comments on commit f3817be

Please sign in to comment.