Fixed space key for row radio and checkbox

pull/1021/head
Cagatay Civici 2021-02-18 11:45:14 +03:00
parent 38b1f81c1c
commit 658612f40f
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="p-checkbox p-component" @click="onClick" @keydown.space.prevent="onClick">
<div class="p-checkbox p-component" @click="onClick">
<div ref="box" :class="['p-checkbox-box p-component', {'p-highlight': checked, 'p-disabled': $attrs.disabled, 'p-focus': focused}]"
role="checkbox" :aria-checked="checked" :tabindex="$attrs.disabled ? null : '0'" @focus="onFocus($event)" @blur="onBlur($event)">
role="checkbox" :aria-checked="checked" :tabindex="$attrs.disabled ? null : '0'" @keydown.space.prevent="onClick" @focus="onFocus($event)" @blur="onBlur($event)">
<span :class="['p-checkbox-icon', {'pi pi-check': checked}]"></span>
</div>
</div>

View File

@ -1,5 +1,5 @@
<template>
<div class="p-radiobutton p-component" @click="onClick" tabindex="0" @focus="onFocus($event)" @blur="onBlur($event)">
<div class="p-radiobutton p-component" @click="onClick" tabindex="0" @focus="onFocus($event)" @blur="onBlur($event)" @keydown.space.prevent="onClick">
<div ref="box" :class="['p-radiobutton-box p-component', {'p-highlight': checked, 'p-disabled': $attrs.disabled, 'p-focus': focused}]" role="radio" :aria-checked="checked">
<div class="p-radiobutton-icon"></div>
</div>