Skip to content

Commit

Permalink
Fixed #2813 - Add tabindex property to VirtualScroller
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Jul 29, 2022
1 parent 0552ee1 commit 50b97bc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions api-generator/components/virtualscroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ const VirtualScrollerProps = [
type: "boolean",
default: "false",
description: "Whether to show loader."
},
{
name: "tabindex",
type: "number|string",
default: "0",
description: "Index of the element in tabbing order."
}
];

Expand Down
5 changes: 5 additions & 0 deletions src/components/virtualscroller/VirtualScroller.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ export interface VirtualScrollerProps {
* @param {VirtualScrollerLazyEvent} event - Custom lazy event.
*/
onLazyLoad?: (event: VirtualScrollerLazyEvent) => void;
/**
* Index of the element in tabbing order.
* Default value is 0.
*/
tabindex?: number | string | undefined;
}

export interface VirtualScrollerSlots {
Expand Down
6 changes: 5 additions & 1 deletion src/components/virtualscroller/VirtualScroller.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<template v-if="!disabled">
<div :ref="elementRef" :class="containerClass" :tabindex="0" :style="style" @scroll="onScroll">
<div :ref="elementRef" :class="containerClass" :tabindex="tabindex" :style="style" @scroll="onScroll">
<slot name="content" :styleClass="contentClass" :items="loadedItems" :getItemOptions="getOptions" :loading="d_loading" :getLoaderOptions="getLoaderOptions" :itemSize="itemSize"
:rows="loadedRows" :columns="loadedColumns" :contentRef="contentRef" :spacerStyle="spacerStyle" :contentStyle="contentStyle"
:vertical="isVertical()" :horizontal="isHorizontal()" :both="isBoth()">
Expand Down Expand Up @@ -87,6 +87,10 @@ export default {
showLoader: {
type: Boolean,
default: false
},
tabindex: {
type: Number,
default: 0
}
},
data() {
Expand Down
6 changes: 6 additions & 0 deletions src/views/virtualscroller/VirtualScrollerDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ export default {
<td>false</td>
<td>Whether to show loader.</td>
</tr>
<tr>
<td>tabindex</td>
<td>number</td>
<td>0</td>
<td>Index of the element in tabbing order.</td>
</tr>
</tbody>
</table>
</div>
Expand Down

0 comments on commit 50b97bc

Please sign in to comment.