Fix tabbing over section headings

This commit is contained in:
James Lyne 2021-05-25 23:39:04 +01:00
parent 21fcaad36d
commit 88b27490cb

View File

@ -1,7 +1,7 @@
<template> <template>
<section :class="{'sidebar__section': true, 'section--collapsed': collapsed}"> <section :class="{'sidebar__section': true, 'section--collapsed': collapsed}">
<button :id="`${name}-heading`" type="button" class="section__heading" <button :id="`${name}-heading`" type="button" class="section__heading"
@click.prevent="toggle" @keydown.prevent="handleKeydown" :title="title" @click.prevent="toggle" @keydown="handleKeydown" :title="title"
:aria-expanded="!collapsed" :aria-controls="`${name}-content`"> :aria-expanded="!collapsed" :aria-controls="`${name}-content`">
<slot name="heading"></slot> <slot name="heading"></slot>
</button> </button>
@ -42,6 +42,8 @@
return; return;
} }
e.preventDefault();
this.toggle(); this.toggle();
}, },