Skip to content

Commit

Permalink
feat(tabs): #446 set tabindex=0 on active tab
Browse files Browse the repository at this point in the history
  • Loading branch information
jtommy committed Nov 26, 2022
1 parent 220db52 commit b0e0d0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/oruga-next/src/utils/TabbedChildMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ export default (parentCmp: string) => defineComponent({
h('div',
{
class: this.elementClasses,
'data-id': `${parentCmp}-${this.newValue}`
'data-id': `${parentCmp}-${this.newValue}`,
'tabindex': this.isActive ? 0 : -1
},
content
),
Expand Down
6 changes: 5 additions & 1 deletion packages/oruga/src/utils/TabbedChildMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ export default (parentCmp) => ({
'div',
{
directives: [{ name: 'show', value: this.isActive && this.visible }],
attrs: { 'class': this.elementClasses, 'id': `${parentCmp}-${this.newValue}` }
attrs: {
'class': this.elementClasses,
'id': `${parentCmp}-${this.newValue}`,
'tabindex': this.isActive ? 0 : -1
}
},
this.$slots.default
)
Expand Down

0 comments on commit b0e0d0a

Please sign in to comment.